reorderFromOrder
Requires a customer (portal or buyer app) session.
Re-add every line from a past order onto the shared cart. Returns a SUMMARY, not a bare cart: reorder re-prices at today's catalogue, so the buyer has to be told which lines changed price and which could not be re-added at all.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation ReorderFromOrder($orderId: ID!) {
reorderFromOrder(orderId: $orderId) {
addedCount
mergedCount
cart {
id
addressId
directions
itemCount
subtotal
updatedAt
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ReorderFromOrder($orderId: ID!) {\n reorderFromOrder(orderId: $orderId) {\n addedCount\n mergedCount\n cart {\n id\n addressId\n directions\n itemCount\n subtotal\n updatedAt\n }\n }\n}",
"variables": {
"orderId": "id"
}
}
EOF
Variables:
{
"orderId": "id"
}
Response:
{
"data": {
"reorderFromOrder": {
"addedCount": 0,
"mergedCount": 0,
"cart": {
"id": "id",
"addressId": "id",
"directions": "string",
"itemCount": 0,
"subtotal": 0,
"updatedAt": "2025-01-15T00:00:00Z"
}
}
}
}
reorderFromOrder(
orderId: ID!
): MobileReorderResult!
Arguments
reorderFromOrder.orderId ● ID! non-null scalar
The ID of the order.
Type
MobileReorderResult object
Result of re-adding a past order to the mobile cart. A summary, not a bare cart: reorder re-prices at today's catalogue and can skip a line, and a buyer who taps once must be told both.