Skip to main content

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​

ParameterTypeDescription
idStringRequired. The ID of the order to update.

Request Body​

The request body is a JSON object. All fields are optional.

FieldTypeRequiredDescription
orderStatusStringNoNew order status. See Get Order for values.
paymentStatusStringNoNew payment status. See Get Order for values.
notesStringNoInternal staff notes.
lineItemsArrayNoLines to change, return or add. See Line Item Object.
fulfilledItemsArrayNoShipments to record. See Fulfilled Item Object.
paymentsArrayNoPayments to record. See Payment Object.
taxAmountNumberNoNew tax amount.
shippingCostNumberNoNew shipping cost.
paymentTermStringNoID of a payment term assigned to the order's company.
metaFieldsArrayNoCustom 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.

FieldTypeRequiredDescription
lineItemIdStringNoID of an existing line.
productIdStringNoProduct ID.
variantIdStringNoVariant ID, used with productId.
skuStringNoProduct or variant SKU.
quantityNumberNoNew quantity, greater than 0. Required for new lines.
returnedBooleanNotrue to mark the line as returned, false to restore it. Lines that have shipped cannot be returned.
priceNumberNoFor new lines only. Must match the customer's price for the product.
optionsArrayNoFor new lines only. Variant options, for example [{ "name": "Size", "value": "Large" }].

Fulfilled Item Object​

FieldTypeRequiredDescription
itemsArrayYesShipped lines, each with lineItemId and quantity.
carrierStringNoCarrier name or code.
trackingNumberStringNoTracking number.
trackingUrlStringNoTracking page URL.

Payment Object​

FieldTypeRequiredDescription
paymentMethodIdStringNoID of a payment method. Send this or paymentMethod.
paymentMethodStringNoName of a payment method, for example Check.
amountNumberYesAmount paid. Cannot be more than the unpaid balance.
paymentIdStringNoYour payment reference. Each reference can be used once per order.
notesStringNoNotes 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​

FieldTypeDescription
successBooleanWhether the order was updated.
messageStringResult message.
dataObjectThe 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 fulfilled when every line is fully shipped, or partially fulfilled otherwise, unless you send orderStatus.
  • After a payment, the payment status becomes paid, partially paid or unpaid, unless you send paymentStatus.
  • 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.