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

# Edit Order

> Change an existing Global-e order by adding, exchanging, or removing products.

## Overview

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

<Note>This API does not apply to Shopify.</Note>

## Prerequisites

* The order must be in the **"Received by Global-e"** status. Orders can be edited only when they
  are in this status.

## How order editing works

The following assumptions apply:

* Editing an order to a **lower** value is possible if the payment has not been captured yet.
* Editing an order to a **higher** value is allowed only if the merchant is willing to subsidize the
  difference between the original and the adjusted order value. The end customer is not charged for
  any additional cost. Set `SubsidizeHigherValue` to `1` on the edit request to subsidize the difference;
  if the new value is higher and `SubsidizeHigherValue` is `0`, null, or empty, the editing request fails.
* 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.

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

<div className="api-ref-card">
  <Card title="Edit order — full request & response" icon="pen-to-square" href="/api-reference/edit-order">
    Parameters, the `OrderChangeRequest` schema, the `Merchant.Order` response, examples, and the
    interactive playground for `POST /api/orders/changes`.
  </Card>
</div>

<div className="api-ref-card">
  <Card title="Quote order changes" icon="calculator" href="/api-reference/edit-order-quote">
    Preview the updated order content and prices without applying the change —
    `POST /api/orders/changes/quote`.
  </Card>
</div>

## Use Cases

### Exchange a product in an order

Remove a line item and add its replacement in a single request. Reference the removed item's
`CartItemId` from the new product's `ReplacementOfCartItemId`. First call the **quote** endpoint to
preview the updated order and prices:

```json theme={null}
{
  "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
}
```

The response is a `Merchant.Order` object with the updated content and prices:

```json theme={null}
{
   "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
    }
}
```

To apply the change, send the same request to the [Edit order](/api-reference/edit-order) endpoint
(`POST /api/orders/changes`).
