Skip to main content

Update Full Order

Replaces the order's line items with the list you send, at the prices you send. Use it when your system holds the final version of the order and you want the store to match it. You can also update the status, shipments, payments and metafields in the same request.

To change only some lines or fields, use Update Order instead.

HTTP Request​

  • URL: /orders/update-all/{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 with at least one field.

FieldTypeRequiredDescription
orderStatusStringNopending, processing, partially fulfilled, fulfilled, restocked or cancelled.
paymentStatusStringNounpaid, authorized, declined, partially paid, paid, partially refunded or refunded.
notesStringNoInternal staff notes.
lineItemsArrayNoThe complete list of line items. See Line Item Object.
fulfilledItemsArrayNoShipments to record. See Fulfilled Item Object.
paymentsArrayNoPayments to record. Same fields as in Update Order.
metaFieldsArrayNoCustom field values, each with code and value. Existing codes are updated and new codes are added.

Line Item Object​

To keep an existing line, send its lineItemId. To add a product, send its sku or a product metaField.

FieldTypeRequiredDescription
lineItemIdStringNoID of an existing line to keep.
quantityNumberYesQuantity.
priceNumberYesUnit price.
skuStringNoSKU of the product to add.
metaFieldObjectNoFind the product to add by a product metafield, for example { "code": "erpItemId", "value": "100245" }.
optionsArrayNoVariant options of the product to add, for example [{ "name": "Size", "value": "Large" }].

Fulfilled Item Object​

FieldTypeRequiredDescription
itemsArrayYesShipped lines. Each needs quantity and one of lineItemId, sku (with options for variants) or metaField.
carrierStringNoCarrier name or code.
trackingNumberStringNoTracking number.

cURL Example​

curl --location --request PUT '<BASE_URL>/orders/update-all/664f2310d5775459152d6dd8' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"orderStatus": "processing",
"lineItems": [
{ "lineItemId": "664f2310d5775459152d6ddb", "quantity": 10, "price": 44.5 },
{ "sku": "GLV-2210", "quantity": 24, "price": 6.75, "options": [{ "name": "Size", "value": "Large" }] }
],
"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, the body is empty, or a value is not valid.

Sample JSON Response​

{
"success": true,
"message": "Order updated successfully",
"data": {
"id": "664f2310d5775459152d6dd8",
"entityId": "ORD-1042",
"orderStatus": "processing",
"lineItems": [
{
"id": "664f2310d5775459152d6ddb",
"productId": "663a0cbe516313e5bc94ab30",
"name": "Safety Glasses",
"sku": "SFTY-4006",
"quantity": 10,
"price": 44.5,
"extendedTotalPrice": 445,
"fulfilledQuantity": 0,
"returned": false
},
{
"id": "6650a0b1d5775459152d7110",
"productId": "663a0cbe516313e5bc94ab2c",
"variantId": "663a0cbe516313e5bc94ab2f",
"name": "Work Gloves",
"sku": "GLV-2210-L",
"productSku": "GLV-2210",
"options": [{ "optionName": "Size", "optionValueLabel": "Large", "optionValue": "L" }],
"quantity": 24,
"price": 6.75,
"extendedTotalPrice": 162,
"fulfilledQuantity": 0,
"returned": false
}
],
"subTotal": 607,
"shippingCost": 12,
"taxAmount": 0,
"total": 619
}
}

Response Details​

Order Data​

FieldTypeDescription
successBooleanWhether the order was updated.
messageStringResult message.
dataObjectThe updated order. See Get Order for all fields.

Notes​

  • When you send lineItems, any existing line not in the list is removed. Leave out lineItems to keep the current lines.
  • Line totals are price × quantity. The subtotal is the sum of the lines, and the total is subtotal plus shipping plus tax.
  • When you send payments, the payment status is set from the amount paid.
  • After a shipment, the order status becomes fulfilled when every line is fully shipped, or partially fulfilled otherwise, unless you send orderStatus.
  • The customer receives an order update email.