Skip to main content
Version: 1.0.0

Cart Queries

This section documents the GraphQL queries available for retrieving information about shopping carts in the YSCP platform. Cart queries allow you to fetch details about cart contents, applied coupons, and cart totals.

Available Queries

The following cart queries are available:

  • CartQuery - Retrieves detailed information about a cart, including items, applied coupons, and totals
  • CartRulesQuery - Retrieves information about cart rules and promotions

Common Parameters

Most cart queries require the following parameters:

  • cartId: The unique identifier of the cart to retrieve information about
  • siteId: (Optional) The site ID where the cart was created

Cart Structure

The cart structure returned by cart queries typically includes:

  • Items: The products in the cart, including quantity, price, and custom attributes
  • Billing Address: The billing address associated with the cart
  • Shipping Address: The shipping address associated with the cart
  • Selected Shipping Method: The shipping method selected for the cart
  • Selected Payment Method: The payment method selected for the cart
  • Applied Coupons: Any coupon codes applied to the cart
  • Totals: Various total amounts, including subtotal, tax, shipping, and grand total

Authentication

Cart queries can be performed by both authenticated users and guest users. For guest users, a cart ID must be provided to retrieve the cart information.

Examples

Each query documentation includes examples showing how to use the query and what response to expect.