orderPlace
Turn a cart or a quote into an order. Takes no money, ever: pay the order it returns with paymentCreate.
Placing an order that has already been placed returns the order that exists rather than failing, so the buyer's browser and a payment subscription may both call it and whichever arrives second is harmless. That matters because a buyer who closes the tab after paying must still end up with an order.
Arguments
| Argument | Type | Description |
|---|---|---|
id | ID! | Id of the subject being ordered: a cart, or a quote where composed |
subject | OrderPlaceSubjectType | What the id refers to. Defaults to a cart, so an existing caller needs no
change.Default CART |
Returns
| Field | Type | Description |
|---|---|---|
order | Order | The order that now exists |
payable | Boolean! | Whether a payment may be started for this order right now. Answered by the same rule the payment itself applies, so a true here is not contradicted by the next call. |
orderErrors | [OrderPlaceError!] | Error details if the order could not be placed |
approval | OrderApproval | Why an order that was just placed cannot be paid yet, when an approval flow is the reason. Read authoritatively rather than through the caller, so it is present even for someone who may not query the flow off the order itself. Absent where the order needed no approval, or where it did and has been decided. |
Example
mutation { orderPlace(id: "8a9f0e1c-4b2d-4f6a-9c3e-1d5b7a2f8c40") { order { id orderNumber } payable orderErrors { ... on OrderError { code message } } }}{ "data": { "orderPlace": { "order": { "id": "id-1", "orderNumber": "Example" }, "payable": true, "orderErrors": [ { "code": "TARGET_NOT_FOUND", "message": "Example" } ] } }}The query is the example the schema documents. The response shows its shape with placeholder values.
Served by
| @evolve-framework/commercetools | Resolved |
| @evolve-framework/medusa | Resolved |
| @evolve-framework/sfcc | Resolved |
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-cart:
CartOrderPlace - @evolve-storefront/feature-quote:
QuoteOrderPlace

