Skip to main content

Documentation Portal

Edit Order

Important

This API does not apply to Shopify.

The Edit Order API lets you change an order. The API has two separate URLs with identical structure. The quote URL will return the updated order content and prices without changing the order. To apply the changes, call the editing URL with the same request.

Please note: the edit is not obligated to be identical to the quote total price. It is advised to immediately call the edit request following an approval of a quote.

Assumptions

The following assumptions apply:

  • Orders can be edited only when are with “Received by Global-e” status.

  • Editing an order to a lower value will be possible if the payment has not been captured yet.

  • Editing an order to a higher value will be allowed only if the merchant is willing to subsidize the difference between the original and the adjusted order value. The end customer will not be charged for any additional cost.

  • The edit request must contain new items- new additional products or exchanging current ones. The API cannot be used to only remove items from an order.

EditOrder API

Method/URL

Quote Endpoint

POST https://{server_name}/api/orders/changes/quote

Editing Endpoint

POST https://{server_name}/api/orders/changes
Parameters

Request

Parameter

Type

Description

Mandatory

OrderChangeRequest

Object OrderChangeRequest

Details of changes to order, including of products to add to or remove from the order.

Yes

Response

Parameter

Type

Description

Mandatory

Merchant.Order

Object Merchant.Order

Object with merchant order information.

Yes

Errors

Error Codes

Code

Description

200

Success

400

Bad Request.

  • orderId - order not found.

    Message: “Order {{OrderId}} not found.“·

  • orderId - order is null or empty.

    Message: “OrderId is not provided.“·

  • removedProducts-CartItemId - null or empty.

    Message: “RemovedProduct CartItemId should be provided.“·

  • removedProducts-CartItemId - OrderProduct not found.

    Message: “RemovedProduct with CartItemId {{CartItemId}} not found in order {{OrderId}}.“·

  • removedProducts- Quantity - null or empty or less than 1.

    Message: “RemovedProduct Quantity should be greater than 0 for CartItemId {{CartItemId}}“.·

  • removedProducts-Quantity - greater than OrderProduct quantity.

    Message: “RemovedProduct Quantity should be less or equal to {{OrderPtoduct.Quantity}} for CartItemId {{CartItemId}}“.·

  • newProducts - null or empty.

    Message: “At least one product in NewProducts list should be provided“.·

  • newProducts-CartItemId - null or empty.

    Message: “NewProduct CartItemId should be provided.“·

  • newProducts-CartItemId - not unique. Message: “NewProduct with CartItemId {CartItemId} already exists for this order“.

  • newProducts-replacementOfCartItemId - not valid.

    Message: “NewProduct with CartItemId {{CartItemId}} specifies ReplacementOfCartItemId {{ReplacementOfCartItemId}} that is missing from the RemovedProducts collection.”·

  • newProducts-replacementOfCartItemId - not found in order.

    Message: “ReplacementOfCartItemId {ReplacementOfCartItemId} of NewProduct with CartItemId {CartItemId} not found in the order.”·

  • newProducts- ProductCode - null or empty.

    Message: “NewProduct ProductCode should be provided for CartItemId {{CartItemId}}.”·

  • newProducts-Quantity - null or empty or less than 1.

    Message: “NewProduct Quantity should be greater than 0 for CartItemId {{CartItemId}}.“·

  • newProducts-SalePrice or newProducts-OriginalSalePrice – either not specified or negative.

    Message: “One of the NewProduct fields SalePrice or OriginalSalePrice should be specified and cannot be negative for CartItemId {{CartItemId}}.“·

  • SubsidizeHigherValue - missing, null or empty.

    Message: “SubsidizeHigherValue must be provided.“·

  • SubsidizeHigherValue - wrong value.

    Message: “SubsidizeHigherValue should be provided with a valid value.

403

Forbidden.

orderId - order status is not allowed for order changes.

Message: “Order {{OrderId}} status does not allow to make changes for the order.

Examples

Request

{
  "OrderId": "GE379858112TS",
  "RemovedProducts": [
     {
        "cartItemId": "1",
        "quantity": 1
     }
  ],
  "NewProducts": [
     {
        "ProductCode": "750518703039M",
        "CartItemId": "2",
        "OrderedQuantity": 1,
        "OriginalSalePrice": 125.12,
        "ReplacementOfCartItemId": "1"
     }
  ],
 "subsidizeHigherValue": 0 // enum No = 0, Yes = 1
}

Response

The response payload is a Merchant.Order object.

{
   "OrderId": "GE379858112TS",
   "CurrencyCode": "GBP",
   "Products": [
        {
           "Sku": "750518703039M",
           "CartItemId": "2",
           "ParentCartItemId": null,
           "Quantity": 1,
           "Price": 125.12,
           "InternationalPrice": 160,
           "DiscountedPrice": 125.12,
           "InternationalDiscountedPrice": 160,
        }
    ],
   "Discounts": [
        {
           "Name": "Hidden DDP",
           "Description": "Discount generated to discount the DDP",
           "Price": 8,
           "InternationalPrice": 10.00,
           "ProductCartItemId": null,
        }
    ],
   "TotalDutiesAndTaxesPrice": 79.83,
   "USSalesTax": 0.00,
   "CCFPrice": 12.40,
   "TotalDutiesPaidByCustomerPrice": 0.00,
   "InternationalDetails":
      {
       "CurrencyCode": "EUR",
       "TotalPrice": 160.00,
       "TransactionCurrencyCode": "EUR",
       "TransactionTotalPrice": 160.00,
       "TotalShippingPrice": 0.00,
       "TotalCCFPrice": 14.79,
       "TotalDutiesPrice": 0.00,
       "USSalesTax": 0.00,
       "DutiesGuaranteed": true,
       "ConsignmentFee": 0.0000,
       "DiscountedShippingPrice": 0.00
    }
}

Success Response

OK (200) 

Error Response

{
  "Errors":
  [
    {
     "Code": "B100",
     "Message": "<Validation error>",
     "Description": "<error id>"
    }
  ]
}