Skip to content

orderPlace

Mutationin Checkout

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

ArgumentTypeDescription
idID!Id of the subject being ordered: a cart, or a quote where composed
subjectOrderPlaceSubjectTypeWhat the id refers to. Defaults to a cart, so an existing caller needs no change.Default CART

Returns

OrderPlaceResponse!

FieldTypeDescription
orderOrderThe order that now exists
payableBoolean!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
approvalOrderApprovalWhy 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
}
}
}
}

The query is the example the schema documents. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved
@evolve-framework/sfccResolved

Used by

The storefront packages that send it, in these GraphQL documents: