> ## Documentation Index
> Fetch the complete documentation index at: https://docs-stage.bglobale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Order Products

> The UpdateOrderProducts API lets you update the order product's metadata and country of origin after the order has been created.

## Error Codes

When providing an invalid or non-existent value, the Global-e returns an "ErrorInfo" with an appropriate error message.

| Code | Error Message                                      | Description                                                   |
| ---- | -------------------------------------------------- | ------------------------------------------------------------- |
| D001 | `Orderid %OrderId% not found.`                     | The provided order ID does not exist                          |
| D002 | `CartItemId %CartItemId% not found`                | The provided cart item ID does not exist in this order        |
| D003 | `ProductCode %ProductCode% not found`              | The provided product code does not exist in this order        |
| D004 | `OriginCountryCode %OriginCountryCode% is invalid` | The provided origin country code does not exist in the system |
| D005 | `ProductMetaData %key% cannot have an empty value` | The provided value for product meta-data is empty or null     |


## OpenAPI

````yaml api-reference/specs/updateorderproducts.yaml POST /Order/UpdateOrderProducts
openapi: 3.0.3
info:
  title: UpdateOrderProducts
  version: 1.0.0
  description: >-
    The UpdateOrderProducts API lets you update the order product's metadata and
    country of origin after the order has been created.
  x-scaled-review: true
servers:
  - url: https://{server_name}
    variables:
      server_name:
        default: server_name
        description: Global-e API host (placeholder shown in the documentation).
security: []
tags:
  - name: UpdateOrderProducts
    x-page-title: Update Order Products
  - name: 'Direction: Merchant → Global-e'
  - name: 'Domain: Orders'
paths:
  /Order/UpdateOrderProducts:
    post:
      tags:
        - UpdateOrderProducts
      summary: UpdateOrderProducts
      description: >-
        The UpdateOrderProducts API lets you update the order product's metadata
        and country of origin after the order has been created.
      operationId: updateOrderProducts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrderProductsRequest'
      responses:
        '200':
          description: Indicates the results of the API call.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ResponseInfo'
                  - $ref: '#/components/schemas/ErrorInfo'
components:
  schemas:
    UpdateOrderProductsRequest:
      type: object
      description: The order information and list of products that require updating
      properties:
        MetaDataUpdateType:
          type: string
          description: The type of metadata update. Must be set to Merge.
        OrderId:
          type: string
          description: >-
            Global-e unique identifier or Merchant unique identifier of the
            order that requires updating.
        Products:
          type: array
          description: The list of products that require updating.
          items:
            $ref: '#/components/schemas/Product'
    ResponseInfo:
      type: object
      description: Indicates the results of the API call.
      properties:
        Success:
          type: boolean
          description: >-
            Indicates if the call was successful. Success property value may be
            only TRUE. Otherwise, ErrorInfo will be returned instead.TRUE - Call
            was successfulFALSE - Call failedFor more information see ErrorInfo.
        Reason:
          type: string
          description: Text that optionally describes the reason for Success status.
    ErrorInfo:
      type: object
      properties:
        Code:
          type: string
          description: The error code
        error:
          type: string
          description: The error message
        Description:
          type: string
          description: The error description
    Product:
      type: object
      properties:
        Attributes:
          type: array
          description: The product's custom attributes (such as Color, Size, etc.)
          items:
            $ref: '#/components/schemas/Attributes'
        AttributesEnglish:
          type: array
          description: >-
            The product's custom attributes (such as Color, Size, etc.) in
            English
          items:
            $ref: '#/components/schemas/Attributes'
        BackOrderDate:
          type: string
          description: Estimated date for the backordered item to be in stock
        Brand:
          $ref: '#/components/schemas/Brand'
        CartItemId:
          type: string
          description: >-
            Identifier of the cart item on the Merchant's site. This property
            may be optionally specified in the SendCart method only so that the
            same value can be posted back when creating the order on the
            Merchant's site with the SendOrderToMerchant method.
        CartItemOptionId:
          type: string
          description: >-
            Identifier of the child cart item "option" on the Merchant's site.
            This value must be specified if the current cart item is related to
            a parent item (CartItemId must not be specified for this item
            because this attribute applies only to the "parent" item itself).
            For example, this item might indicate a package for the parent item
            in the same cart. This property may be optionally specified in the
            SendCart method only so that the same value can be posted back when
            creating the order on the Merchant's site with the
            SendOrderToMerchant method.
        Categories:
          type: array
          description: The product's categories
          items:
            $ref: '#/components/schemas/Category'
        DeliveryQuantity:
          type: number
          description: >-
            The quantity actually set for delivery for the product (to be used
            in the Order methods described below, as needed)
        Description:
          type: string
          description: Description of the Product
        DescriptionEnglish:
          type: string
          description: Description of the Product in English
        GenericHSCode:
          type: string
          description: >-
            The product's generic HS Code (not country-specific). If specified
            this property may assist in mapping the product for duties and taxes
            calculation purposes.
        GiftMessage:
          type: string
          description: >-
            Optional "gift message" text defined by the end customer to be
            printed on the product.
        HandlingCode:
          type: string
          description: >-
            Code applicable to the product on the Merchant's site. This code may
            be optionally used by the Merchant to trigger a certain business
            logic when this product is included in the order posted back to the
            Merchant's site with the SendOrderToMerchant method.
        Height:
          type: number
          description: >-
            The product's height in the Merchant's default unit of length
            measure (will be converted to CM).
        HubCode:
          type: string
          description: >-
            The Merchant hub code indicates from which hub the product was sent.
            Note that the HubCode should be mapped to a Global-e hubId on the
            Global-e side.
        ImageHeight:
          type: number
          description: The product's image height in pixels
        ImageURL:
          type: string
          description: The product's image URL
        ImageWidth:
          type: number
          description: The product's image width in pixels
        IsBackOrdered:
          type: boolean
          description: >-
            Boolean specifying if the product was ordered as a back ordered
            item.TRUE - The item is back orderedFALSE - The item is not back
            ordered. Default FALSE.
        IsBlockedForGlobalE:
          type: boolean
          description: >-
            Indicates if product is available for international shipping.TRUE -
            The product is not available for international shippingFALSE - The
            product is available for international shipping
        IsBundle:
          type: boolean
          description: >-
            Indicates if the product represents a set of products.TRUE - The
            product represents a set of other products. If a bundled product has
            non-zero prices specified (i.e. OriginalListPrice, ListPrice, etc.),
            then all the contained products must have zero prices, and vice
            versa, to avoid double charging for the same products.FALSE - The
            product does not represent a set of other products.
        IsFixedPrice:
          type: boolean
          description: >-
            Indicates if the product's price is fixed by the Merchant, in the
            default currency for the country.TRUE - The product's price is
            fixed. In this case, all price modifications are disabled for this
            product. Setting fixed prices is only allowed for the Countries
            where the SupportsFixedPrices flag is set to TRUE.FALSE - The
            product's price is not fixed.
        IsVirtual:
          type: boolean
          description: >-
            Indicates if the product represents a virtual product that does not
            have weight or volume and doesn't affect shipping calculation in
            Global-e checkoutTRUE - The product represents a virtual
            productFALSE - The product does not represent a virtual product
        Keywords:
          type: string
          description: The product's keywords
        Length:
          type: number
          description: >-
            The product's length in the Merchant's default unit of length
            measure (will be converted to CM).
        LineItemOriginalSalePrice:
          type: number
          description: >-
            Line item (product in ordered quantity) sale price in the original
            Merchant's currency including the local VAT, before applying any
            price modifications. This property always denotes the price in the
            default Merchant's country, regardless of UseCountryVAT for the end
            customer's current country. If not specified, will be deemed equal
            to "OriginalSalePrice* OrderedQuantity". If specified, will take
            preference over OriginalSalePrice.
        LineItemSalePrice:
          type: number
          description: >-
            Line item (product in ordered quantity) sale price as displayed to
            the customer, after applying country coefficient, FX conversion and
            IncludeVAT handling, before rounding rules have been applied. If not
            specified, will be deemed equal to "SalePrice * OrderedQuantity". If
            specified, will take preference over SalePrice.
        ListPrice:
          type: number
          description: >-
            Product list price (before discounts) as displayed to the customer,
            after applying country coefficient, FX conversion, rounding rule (if
            applicable) and IncludeVAT handling.
        LocalVATRateType:
          allOf:
            - $ref: '#/components/schemas/VATRateType'
          description: >-
            VAT rate type or class that would be applied to this product if the
            order was placed by the local customer. This value must be specified
            if UseCountryVAT for the current Country is TRUE, and therefore the
            VATRateType property actually denotes the VAT for the target
            country.
        MetaData:
          allOf:
            - $ref: '#/components/schemas/ProductMetaData'
          description: >-
            Used to hold additional product data such as customer-defined
            product attributes.
        Name:
          type: string
          description: Name of the Product
        NameEnglish:
          type: string
          description: Name of the Product in English
        NetVolume:
          type: number
          description: >-
            The product's net volume in the Merchant's default unit of volume
            measure (will be converted to cubic CM). If specified, this property
            indicates the net volume of the product, excluding any packaging.
        NetWeight:
          type: number
          description: >-
            The product's net weight in the Merchant's default unit of weight
            measure (will be converted to grams). If specified, this property
            indicates the net weight of the product, excluding any packaging.
        OrderedQuantity:
          type: number
          description: >-
            Ordered quantity for the product (to be used in Checkout / Order
            methods described below, as needed)
        OriginalListPrice:
          type: number
          description: >-
            Product list price (before any discounts) in the original Merchant's
            currency including the local VAT, before applying any price
            modifications. This property always denotes the product's price in
            the default Merchant's country, regardless of UseCountryVAT for the
            end customer's current country.
        OriginalSalePrice:
          type: number
          description: >-
            Product sale price in the original Merchant's currency including the
            local VAT, before applying any price modifications. This property
            always denotes the product's price in the default Merchant's
            country, regardless of UseCountryVAT for the end customer's current
            country.
        OriginCountryCode:
          type: string
          description: >-
            2-char ISO country code of the product's country of Origin. The
            Merchant's country will be assumed if not specified.
        ParentCartItemId:
          type: string
          description: >-
            Identifier of the current item's parent cart item on the Merchant's
            site. This value must be specified if the current cart item is
            related to a parent item (CartItemId must not be specified for this
            item because this attribute applies only to the "parent" item
            itself). For example, this item might indicate a custom option (such
            as a product package) for the parent item in the same cart. This
            property may be optionally specified in the SendCart method only so
            that the same value can be posted back when creating the order on
            the Merchant's site with the SendOrderToMerchant method.
        PriceCoefficientRate:
          type: number
          description: >-
            Rate applicable to this Product's ProductClassCode if returned from
            the CountryCoefficients method.
        ProductClassCode:
          type: string
          description: >-
            The product class code is used by the Merchant to classify products
            to use different country coefficient rates.
        ProductCode:
          type: string
          description: >-
            SKU code used to identify the product on the Merchant's site (to be
            mapped on the Global-e side)
        ProductCodeSecondary:
          type: string
          description: >-
            Secondary code that may be used to refer to the product on the
            Merchant's site. This code may be used in addition to the
            ProductCode and is not guaranteed to be unique (may be reused for
            other products as long as the old product is not available on the
            Merchant's site any more).
        ProductGroupCode:
          type: string
          description: >-
            Product's group code on the Merchant's site (to be mapped on the
            Global-e side). Usually, this value is a part of the product SKU
            code denoting a group of similar products (such as "the same product
            in different s").
        ProductGroupCodeSecondary:
          type: string
          description: >-
            Secondary code that may refer to the group of products on the
            Merchant's site. This code may be used in addition to the
            ProductGroupCode and is not guaranteed to be unique (may be reused
            for other groups as long as the old group is not available on the
            Merchant's site anymore).
        SalePrice:
          type: number
          description: >-
            Product sale price as displayed to the customer, after applying
            country coefficient, FX conversion, rounding rule (if applicable)
            and IncludeVAT handling.
        SalePriceBeforeRounding:
          type: number
          description: >-
            Product sale price as displayed to the customer, after applying
            country coefficient, FX conversion and IncludeVAT handling, before
            rounding rules have been applied. If not specified, will be deemed
            equal to SalePrice.
        SalePriceReason:
          type: string
          description: >-
            Reason for the sale price. This property may optionally contain the
            text definition of the promo that has resulted in the price
            deduction for this product (such as "10% discount on all shoes").
        URL:
          type: string
          description: The product's information page URL
        VATCategory:
          allOf:
            - $ref: '#/components/schemas/VATCategory'
          description: >-
            The product's VAT category. A product may be assigned to a single
            VAT category on the Merchant's site. If available, the respective
            product's HS Code should be used as the VAT category for a product.
        VATRateType:
          allOf:
            - $ref: '#/components/schemas/VATRateType'
          description: Product's VAT rate type or class
        Volume:
          type: number
          description: >-
            The product's volume in the Merchant's default unit of volume
            measure (will be converted to cubic CM).
        Weight:
          type: number
          description: >-
            The product's weight is in the Merchant's default unit of weight
            measure (will be converted to grams). The Merchant's default product
            weight will be used if not specified.
        Width:
          type: number
          description: >-
            The product's width in the Merchant's default unit of length measure
            (will be converted to CM).
    Attributes:
      type: object
      properties:
        AttributeCode:
          type: string
          description: >-
            Custom attribute code denoting a Merchant-specific attribute such as
            size, color, etc. (to be mapped on the Global-e side)
        AttributeTypeCode:
          type: string
          description: >-
            Code used to identify the attribute type on the Merchant's site such
            as "size" for size, "color" for "colour", etc. (to be mapped on the
            Global-e side)
        Name:
          type: string
          description: Attribute name
    Brand:
      type: object
      properties:
        BrandCode:
          type: string
          description: >-
            Brand code on the Merchant's site (to be mapped on the Global-e
            side)
        Name:
          type: string
          description: Brand name
    Category:
      type: object
      properties:
        CategoryCode:
          type: string
          description: >-
            Category code on the Merchant site (to be mapped on the Global-e
            side)
        Name:
          type: string
          description: Category name
    VATRateType:
      type: object
      properties:
        Name:
          type: string
          description: VAT rate type name
        Rate:
          type: number
          description: VAT rate decimal value
        VATRateTypeCode:
          type: string
          description: >-
            VAT rate type (or class) code on the Merchant's site (to be mapped
            on the Global-e side)
    ProductMetaData:
      type: object
      properties:
        Attributes:
          type: array
          description: >-
            Customer-defined product attributes that allow the personalisation
            of the product if supported by the merchant's site (e.g. engraving)
          items:
            $ref: '#/components/schemas/Attributes'
    VATCategory:
      type: object
      properties:
        Name:
          type: string
          description: VAT Category name
        VATCategoryCode:
          type: string
          description: >-
            Code used to identify the VAT category on the Merchant's site (to be
            mapped on the Global-e side)

````