Skip to main content
Version: 1.0.0

Checkout Mutations

This section documents the GraphQL mutations available for managing the checkout process in the YSCP platform. Checkout mutations allow you to set shipping and billing addresses, select shipping methods, and complete the checkout process.

Available Mutations

The following checkout mutations are available:

Common Parameters

Most checkout mutations require the following parameters:

  • cartId: The unique identifier of the cart to operate on
  • siteId: (Optional) The site ID where the checkout is being performed

Checkout Flow

The typical checkout flow involves the following steps:

  1. Create a cart and add products (using cart mutations)
  2. Set the billing address (using SetBillingAddressOnCheckoutMutation)
  3. Set the shipping address (if different from billing)
  4. Get available shipping methods (using AvailableShippingMethodsQuery)
  5. Select a shipping method (using SetShippingMethodOnCheckoutMutation)
  6. Get available payment methods (using AvailablePaymentMethodsQuery)
  7. Select a payment method and complete the checkout

Error Handling

Checkout mutations may return errors in the following cases:

  • Invalid cart ID
  • Invalid address information
  • Shipping method not available for the specified address
  • Required fields missing

Each error includes a message explaining the issue and how to resolve it.