cartAddItem
Add a product item to the shopping cart.
Adds a single product to the cart with specified quantity and configuration. Supports simple products, configurable products with clusters, and custom pricing. Cart totals are automatically recalculated.
Possible errors:
- CART_NOT_FOUND_ERROR: Cart with the specified ID does not exist
- CART_ITEM_ADD_ERROR: Failed to add the item to the cart
- PRODUCT_NOT_FOUND_ERROR: Specified product does not exist
- PRODUCT_INVALID_ERROR: Product is not valid or available for purchase
- CLUSTER_INVALID_CONFIGURATION_ERROR: Invalid cluster configuration for configurable products
- ATTRIBUTE_VALIDATION_ERROR: One or more attributes are not valid for this tenant
A product the catalogue will not sell to this contact/company/channel is never dropped without a trace: it is returned under unOrderableItems on the resulting Cart instead of under items. Select that field to detect a product that was accepted but cannot be ordered. A line that reaches neither list is a failure, and is reported as CART_ITEM_ADD_ERROR rather than as a Cart with the product missing.
cartAddItem(
id: String!
input: CartAddItemInput!
): Cart!
Arguments
cartAddItem.id ● String! non-null scalar
Unique identifier of the cart to add the item to.
Must be a valid UUID format representing an existing cart.
cartAddItem.input ● CartAddItemInput! non-null input
Product item information to add to the cart.
Contains product ID, quantity, pricing overrides, and configuration options for complex products.
Type
Cart object
Shopping cart entity for managing customer purchases.
Represents a shopping session containing products, customer information, addresses, payment preferences, and all data needed for order processing. Carts can be associated with different customer types and support various business models.