Prepare the mutation input
The orderCreate
mutation requires specific input data. While additional fields are available, the following fields are required:
productId
orsku
: 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:
Mutation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
mutation {
orderItemUpdate(
orderId: "order_4f52ec0e-3467-11ed-b878-0242ac120002"
accountOrderNumber: "AO-67890"
itemId: "item_8659ec0e-3467-11ed-b878-0242ac120002"
itemSku: "T123-BLUE"
quantity: 1
) {
order {
accountOrderNumber
createdAt
createdBy
currencyCode
id
items {
id
name
quantity
amount
currencyCode
}
status
updatedAt
updatedBy
}
}
}
Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"data": {
"orderItemUpdate": {
"order": {
"accountOrderNumber": "AO-67890",
"createdAt": "2024-06-01T12:00:00Z",
"createdBy": "user_3258ec0e-3467-11ed-b878-0242ac120002",
"currencyCode": "USD",
"id": "order_4f52ec0e-3467-11ed-b878-0242ac120002",
"items": [
{
"id": "item_8659ec0e-3467-11ed-b878-0242ac120002",
"name": "T-Shirt",
"quantity": 0,
"amount": 19.99,
"currencyCode": "USD"
}
],
"status": "OPEN",
"updatedAt": "2024-07-09T12:20:00Z",
"updatedBy": "user_4258ec0e-3467-11ed-b878-0242ac120002"
}
}
}
}
Create orders
Learn how to update items on an order.GraphQL
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 newlandedCost
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.