DOCS

Update orders

Update orders

Learn how to update items on an order.

COMING SOON

If you have created an order but realize that not all items can be fulfilled due to short ships or other unforseen circusmtances, you can use the orderItemUpdate mutation to remove items from the order. Once an item is removed, we will run a new landedCost calculation and update invoice for this order to reflect the new amount you will be charged. If you have already been charged, we will add that amount as a credit on your upcoming invoice.

Prepare the mutation input 

The orderCreate mutation requires specific input data. While additional fields are available, the following fields are required:

  • productId or sku: The product ID or SKU that you use to identify items on the order (The value you use to identify products in your system).
  • accountOrderNumber: The order number you assigned to the order (often the platform's order number).

You can only remove items from an order if they have not been shipped.

Send the mutation 

Once you have the required input data, send the GraphQL mutation to the API endpoint using your chosen client library or tool. Here's an example of how you can structure the mutation:

1mutation {
2 orderItemUpdate(
3 orderId: "order_4f52ec0e-3467-11ed-b878-0242ac120002"
4 accountOrderNumber: "AO-67890"
5 itemId: "item_8659ec0e-3467-11ed-b878-0242ac120002"
6 itemSku: "T123-BLUE"
7 quantity: 1
8 ) {
9 order {
10 accountOrderNumber
11 createdAt
12 createdBy
13 currencyCode
14 id
15 items {
16 id
17 name
18 quantity
19 amount
20 currencyCode
21 }
22 status
23 updatedAt
24 updatedBy
25 }
26 }
27}

Was this page helpful?