Checkout Queries
This section documents the GraphQL queries available for retrieving information about the checkout process in the YSCP platform. Checkout queries allow you to fetch details about available shipping methods, payment methods, and other checkout-related information.
Available Queries
The following checkout queries are available:
- AvailableShippingMethodsQuery - Retrieves the shipping methods available for a cart based on the shipping address.
- AvailablePaymentMethodsQuery - Retrieves the payment methods available for a cart based on the selected shipping method and other factors.
Common Parameters
Most checkout queries require the following parameters:
cartId: The unique identifier of the cart to retrieve information aboutsiteId: (Optional) The site ID where the checkout is being performed
Checkout Flow
The typical checkout flow involves the following steps:
- Create a cart and add products (using cart mutations)
- Set the billing address (using SetBillingAddressOnCheckoutMutation)
- Set the shipping address (if different from billing)
- Get available shipping methods (using AvailableShippingMethodsQuery)
- Select a shipping method (using SetShippingMethodOnCheckoutMutation)
- Get available payment methods (using AvailablePaymentMethodsQuery)
- Select a payment method and complete the checkout
Authentication
Checkout queries can be performed by both authenticated users and guest users. For guest users, a cart ID must be provided to retrieve the checkout information.
Examples
Each query documentation includes examples showing how to use the query and what response to expect.