Fields


id
ID!
required

The unique identifier (ID) of the cart, used to reference and interact with the cart in subsequent API operations.

stores
[Store!]!
required

An array of Store objects (either AmazonStore or ShopifyStore), each representing a store with items in the cart. Each store object contains its own specific data, such as store name, cart lines, and offer information.

buyerIdentity
BuyerIdentity

An object containing information about the buyer, such as first name, last name, email, phone, and address details. This information is used during the checkout process and for communication with the buyer.

cost
CartCost

The costs that the buyer will pay at checkout

isShippingRequired
Boolean

If your cart only contains digital items, this will be false as there will be no shipping required.

Queries


getCart(id: ID!)

Returns a Cart object by ID.


Mutations


createCart(input: CartCreateInput!)

Create a Cart with buyer identity details


updateCartItems(input: CartItemsUpdateInput!)

Updates only existing products in a Cart. Returns an error if prompted to update a non-existing product.


updateCartBuyerIdentity(input: CartBuyerIdentityUpdateInput!)

Updates buyer identity if not provided in createCart mutation


addCartItems(input: CartItemsAddInput!)

Adds only non-existing products in a Cart. Skips already existing products.


deleteCartItems(input: CartItemsDeleteInput!)

Removes existing products in a Cart. Returns an error if prompted to delete a non-existing product.


Note about expiration

Rye considers carts to be expired after 10 days. If you attempt an operation on an expired cart, you’ll receive an error message that looks like this:

JSON
{
    "errors": [
        {
            "message": "Cart expired: someExpiredCartId",
            "locations": [
                {
                    "line": 2,
                    "column": 5
                }
            ],
            "path": [
                "someOperationPath"
            ],
            "extensions": {
                "code": "CART_EXPIRED_ERROR"
            }
        }
    ],
    "data": null
}