Skip to content

Checkout

The Checkout menu turns a prepared cart into a placed order. It runs as an ordered sequence — set the address, pick a shipping method, pick a payment method, then place the order — and provides queries to read the saved addresses and the available shipping / payment options at each step.

The checkout sequence

Checkout must run in order, because each step depends on the one before:

  1. Set the checkout address (billing, and shipping unless the cart is virtual / downloadable only).
  2. Get shipping methods for the saved address, then set the chosen shipping method.
  3. Get payment methods available once shipping is selected, then set the chosen payment method.
  4. Place the order to finalise the cart into an order.

Calling a step out of sequence (for example, fetching shipping methods before an address is saved) fails — finish the previous step first.

Operations in this menu

OperationGraphQL field
Get Addressesaddresses query
Get Shipping MethodsshippingMethods query
Get Payment MethodspaymentMethods query
Set Checkout AddresssaveCheckoutAddresses mutation
Set Shipping MethodsaveShippingMethod mutation
Set Payment MethodsavePaymentMethod mutation
Place OrderplaceOrder mutation

Checkout operates on the cart (identified by its cart token); a guest needs only the storefront key, while a signed-in customer also sends their Bearer token. See Authentication.

Released under the MIT License.