Update Order
Updates an existing order. Only the fields you send are changed. You can change the status, adjust or add line items, record shipments and payments, and update tax, shipping cost and metafields.
To replace the complete list of line items with your own prices, use Update Full Order instead.
HTTP Request
- URL:
/orders/{id} - Method:
PUT - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_ORDER
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the order to update. |
Request Body
The request body is a JSON object. All fields are optional.
| Field | Type | Required | Description |
|---|---|---|---|
orderStatus | String | No | New order status. See Get Order for values. |
paymentStatus | String | No | New payment status. See Get Order for values. |
notes | String | No | Internal staff notes. |
lineItems | Array | No | Lines to change, return or add. See Line Item Object. |
fulfilledItems | Array | No | Shipments to record. See Fulfilled Item Object. |
payments | Array | No | Payments to record. See Payment Object. |
taxAmount | Number | No | New tax amount. |
shippingCost | Number | No | New shipping cost. |
paymentTerm | String | No | ID of a payment term assigned to the order's company. |
metaFields | Array | No | Custom field values, each with code and value. Existing codes are updated and new codes are added. |
Line Item Object
Each entry updates an existing line, found by lineItemId, productId (with variantId) or sku. If no line matches, the product is added as a new line.
| Field | Type | Required | Description |
|---|---|---|---|
lineItemId | String | No | ID of an existing line. |
productId | String | No | Product ID. |
variantId | String | No | Variant ID, used with productId. |
sku | String | No | Product or variant SKU. |
quantity | Number | No | New quantity, greater than 0. Required for new lines. |
returned | Boolean | No | true to mark the line as returned, false to restore it. Lines that have shipped cannot be returned. |
price | Number | No | For new lines only. Must match the customer's price for the product. |
options | Array | No | For new lines only. Variant options, for example [{ "name": "Size", "value": "Large" }]. |
Fulfilled Item Object
| Field | Type | Required | Description |
|---|---|---|---|
items | Array | Yes | Shipped lines, each with lineItemId and quantity. |
carrier | String | No | Carrier name or code. |
trackingNumber | String | No | Tracking number. |
trackingUrl | String | No | Tracking page URL. |
Payment Object
| Field | Type | Required | Description |
|---|---|---|---|
paymentMethodId | String | No | ID of a payment method. Send this or paymentMethod. |
paymentMethod | String | No | Name of a payment method, for example Check. |
amount | Number | Yes | Amount paid. Cannot be more than the unpaid balance. |
paymentId | String | No | Your payment reference. Each reference can be used once per order. |
notes | String | No | Notes about the payment. |
cURL Example
curl --location --request PUT '<BASE_URL>/orders/664f2310d5775459152d6dd8' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"notes": "Customer requested split shipment.",
"fulfilledItems": [
{
"items": [{ "lineItemId": "664f2310d5775459152d6ddb", "quantity": 6 }],
"carrier": "UPS",
"trackingNumber": "1Z999AA10123456784"
}
],
"payments": [
{ "paymentMethod": "Check", "amount": 200, "paymentId": "CHK-20931", "notes": "Partial payment" }
],
"metaFields": [{ "code": "erpOrderId", "value": "SO-88213" }]
}'
Response
- 200 OK: The order was updated. If no order exists with this ID, the response has
"success": false. - 400 Bad Request: The access token is missing or invalid, or a value is not valid (for example, a payment larger than the unpaid balance or a quantity larger than ordered).
Sample JSON Response
{
"success": true,
"message": "Order updated successfully",
"data": {
"id": "664f2310d5775459152d6dd8",
"entityId": "ORD-1042",
"orderStatus": "partially fulfilled",
"paymentStatus": "partially paid",
"staffNotes": "Customer requested split shipment.",
"subTotal": 540,
"taxAmount": 0,
"shippingCost": 12,
"total": 552,
"totalPaid": 200,
"payments": [
{
"id": "666f2310d5775459152d6ff4",
"entityId": "PMT-1012",
"amount": 200,
"status": "captured",
"methodLabel": "Check",
"type": "external",
"gatewayRef": "CHK-20931",
"notes": "Partial payment"
}
]
}
}
Response Details
Order Data
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the order was updated. |
message | String | Result message. |
data | Object | The updated order. See Get Order for all fields. |
Notes
- New lines are priced from the catalog and must be active and in stock.
- After a shipment, the order status becomes
fulfilledwhen every line is fully shipped, orpartially fulfilledotherwise, unless you sendorderStatus. - After a payment, the payment status becomes
paid,partially paidorunpaid, unless you sendpaymentStatus. - The order total is recalculated as subtotal plus tax plus shipping.
- The customer receives an order update email. When the order becomes fulfilled, the customer also receives a fulfillment email.
- To ship an order with a shipping label or package details, use Ship Order.