customerReorderFromOrder
Requires a customer (portal or buyer app) session.
Merge every line of a past order into the shared cart via the CustomerCartService public API (repriced server-side). screen 6/8. Returns the cart plus per-line added/skipped.
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 CustomerReorderFromOrder($orderId: ID!) {
customerReorderFromOrder(orderId: $orderId) {
added {
name
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CustomerReorderFromOrder($orderId: ID!) {\n customerReorderFromOrder(orderId: $orderId) {\n added {\n name\n }\n }\n}",
"variables": {
"orderId": "id"
}
}
EOF
Variables:
{
"orderId": "id"
}
Response:
{
"data": {
"customerReorderFromOrder": {
"added": [
{
"name": "string"
}
]
}
}
}
customerReorderFromOrder(
orderId: ID!
skipLinesInCart: Boolean = false
): CartBulkAddResult!
Arguments
customerReorderFromOrder.orderId ● ID! non-null scalar
The ID of the order.
customerReorderFromOrder.skipLinesInCart ● Boolean scalar
Skip lines already in the cart (reported as ALREADY_IN_CART) instead of adding their quantity on top. Quick order's Previous orders tab sets it.
Type
CartBulkAddResult object
Result of a bulk add to the cart (reorder from an order, add a whole buying list): the cart plus exactly which lines were added and which were skipped and why. An add that adds nothing is added: [], never success.