Skip to main content
Version: 1.0.0

Cart Mutations

This section documents the GraphQL mutations available for managing shopping carts in the YSCP platform. Cart mutations allow you to create carts, add products, apply coupons, and perform other cart-related operations.

Available Mutations

The following cart mutations are available:

Common Parameters

Most cart mutations require the following parameters:

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

Authentication

Cart mutations can be performed by both authenticated users and guest users. For guest users, a cart ID must be obtained from the createGuestCart mutation before other cart operations can be performed.

Error Handling

Cart mutations may return errors in the following cases:

  • Invalid cart ID
  • Product not found
  • Insufficient stock
  • Invalid coupon code
  • Coupon usage limit exceeded
  • Coupon expired

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