checkoutSubmit Mutation
Description
Submits the checkout and creates an order. The checkout must contain at least one item and cannot exceed the maximum items per checkout limit. After submission, the checkout status is set to complete and stock quantities are updated.
mutation checkoutSubmit($id: String!, $collected: Boolean, $version: Int) {
checkoutSubmit(id: $id, collected: $collected, version: $version) {
checkout {
_id
id
version
origin
created
orderId
updated
expires
status
useSingleAddress
locationRef
}
order {
_id
id
incId
origin
created
modified
orderId
instructions
updated
status
discogsStatus
buyerWasContacted
unreadMessagesCount
path
}
}
}
Variables
{
"id": "tl5-fyhbE",
"collected": true,
"version": 42
}
Response
{
"checkoutSubmit": {
"checkout": {
"_id": "7b7b7a7d55650c621b04baa0",
"id": "HfT-mOHhl",
"version": 42,
"origin": "example",
"created": 1732536775930,
"orderId": "example",
"updated": 1775576469454,
"expires": 1789243185007,
"status": "open",
"useSingleAddress": true,
"locationRef": "103a1089590fdb642e943089"
},
"order": {
"_id": "8afdf65888df50555b080d7a",
"id": "qoG-YfuKO",
"incId": 42,
"origin": "example",
"created": 1735412697034,
"modified": 1793591807972,
"orderId": "example",
"instructions": "example",
"updated": 1754972498757,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"path": "/release/1763553751/release-artist-release-name"
}
}
}
Arguments
| Name | Type | Description |
|---|---|---|
id | String! | String identifier of the checkout to submit. |
collected | Boolean | Whether the order items have been collected. If true and payment is complete, the order status is set to Shipped. |
version | Int | Current version number of the checkout for optimistic locking. Prevents conflicts when multiple users edit simultaneously. |