Skip to main content

Place an order from the cart

Process the cart into a confirmed order.

Mutation

mutation PlaceOrder($cartId: String!) {
cartProcess(
id: $cartId
input: { orderStatus: "NEW" }
) {
cartOrderId
}
}

Variables

{
"cartId": "019c77b7-565f-7ea0-8660-42bc63a7f728"
}

Response

{
"data": {
"cartProcess": {
"cartOrderId": "34567"
}
}
}

How it works

cartProcess converts the cart into an order. The orderStatus sets the initial status: use "NEW" for an order that needs no online payment, "UNFINISHED" when a payment service provider collects payment after this step, or "REQUEST" for a quote request. Statuses are configured per tenant, see Understanding the order lifecycle. The returned cartOrderId is the order ID you can use to query the order with order(orderId: 34567). Before calling this mutation, ensure the cart has addresses set, a payment method selected, and at least one item. The optional language field controls which language the order confirmation email is sent in.

See also