Skip to main content

cartValidateAndProcess

Recalculate the cart, check it against what the customer was last shown, and convert it to an order only if nothing changed.

The checkout counterpart to recalculationMode: CHANGED_ITEMS_ONLY, under which item mutations reuse earlier figures rather than repricing every line. Such a cart can be carrying prices, product data and orderability that are stale, so this recalculates all of it and refuses to place the order if the result differs from what was last shown.

Being refused is a normal outcome, not an error: status is CHANGED, cartOrderId is null, changes says what moved, and cart is the refreshed cart to show the customer so they can decide again. A cart whose cache has expired is refused too — with no record of what was on screen, nothing can be claimed to match it.

Required for a CHANGED_ITEMS_ONLY cart, which cartProcess refuses. Works for any cart.

Possible errors:

  • CART_NOT_FOUND_ERROR: Cart with the specified ID does not exist
  • CART_PROCESS_ERROR: Failed to process the cart
  • CART_INVALID_STATUS_ERROR: Cart is not in a processable state
  • CART_CONCURRENT_WRITE_ERROR: The cart is already being processed
cartValidateAndProcess(
id: String!
input: CartProcessInput!
): CartValidateAndProcessResponse!

Arguments​

cartValidateAndProcess.id ● String! non-null scalar​

Unique identifier of the cart to validate and process.

Must be a valid UUID format representing an existing cart ready for checkout.

cartValidateAndProcess.input ● CartProcessInput! non-null input​

Cart processing configuration.

Contains final checkout parameters including payment confirmation, delivery preferences, and processing options.

Type​

CartValidateAndProcessResponse object​

Response from validating a cart and, if nothing changed, processing it into an order.

Unlike cartProcess, this recalculates the whole cart first and refuses to place the order if the result differs from what the customer was last shown. Required for carts whose recalculationMode is CHANGED_ITEMS_ONLY, and usable for any cart.