Rebrand 2023 Learn more 

  • Commerce Cloud/
    Carts/
    Cart Management API/
    Carts Management Overview

    Cart Management Overview

    A Cart contains the product and custom cart items that a user intends to purchase. After a Cart is ready for Checkout, you can use the Checkout endpoint to convert the cart to an order.

    Adding, modifying, or removing any cart items, custom items, or promotions always returns the cart meta, calculated using the calculation method. This is useful to update the client with up-to-date totals.

    We will automatically delete carts 7 days after they were last updated.

    If you do not pass a X-MOLTIN-CURRENCY header specifying what currency you would like the cart to use, the products in the cart are converted to your default currency.

    The Cart object

    Attributes

    AttributeTypeDescription
    idstringThe unique identifier for the cart. Use SDK or create it yourself.
    typestringThe type of object being returned.
    namestringThe name of this item.
    descriptionstringA description of the cart item.
    linksobjectThe links object.
    metaobjectAdditional information calculated for this cart.

    Sample Object

    {
        "data": {
            "id": "1",
            "name": "Cart",
            "description": "",
            "type": "cart",
            "links": {
                "self": "https://useast.api.elasticpath.com/carts/carts/1"
            },
            "meta": {
                "display_price": {
                    "with_tax": {
                        "amount": 0,
                        "currency": "",
                        "formatted": "0"
                    },
                    "without_tax": {
                        "amount": 0,
                        "currency": "",
                        "formatted": "0"
                    },
                    "tax": {
                        "amount": 0,
                        "currency": "",
                        "formatted": "0"
                    },
                    "discount": {
                        "amount": 0,
                        "currency": "",
                        "formatted": "0"
                    },
                    "without_discount": {
                        "amount": 0,
                        "currency": "",
                        "formatted": "0"
                    }
                },
                "timestamps": {
                    "created_at": "2023-01-06T20:12:23Z",
                    "updated_at": "2023-01-12T16:09:59Z",
                    "expires_at": "2023-01-19T16:09:59Z"
                }
            },
            "relationships": {
                "items": {
                    "data": null
                },
                "customers": {}
            }
        }
    }
    
    AttributeTypeDescription
    selfstringThe URL of this cart.

    The Cart meta object

    The meta object includes the calculated card totals.

    AttributeTypeDescription
    meta.display_priceobjectA collection of fields related to the total and currency of this cart.
    meta.display_price.with_taxobjectTax inclusive totals.
    meta.display_price.with_tax.amountintegerThe raw total of this cart (inclusive of tax).
    meta.display_price.with_tax.currencystringThe currency set for this cart.
    meta.display_price.with_tax.formattedstringThe tax inclusive formatted total based on the currency.
    meta.display_price.without_taxobjectTax exclusive totals.
    meta.display_price.without_tax.amountintegerThe raw total of this cart (exclusive of tax).
    meta.display_price.without_tax.currencystringThe currency set for this cart.
    meta.display_price.without_tax.formattedstringThe tax exclusive formatted total based on the currency.
    meta.display_price.taxobjectTax totals.
    meta.display_price.tax.amountintegerThe subtotal of the added tax value.
    meta.display_price.tax.currencystringThe currency set for the tax.
    meta.display_price.tax.formattedstringThe formatted value for the tax subtotal.
    meta.display_price.discountobjectThe discount object describes amount, currency, formatted value of the cart with the discount.
    meta.display_price.discount.amountintegerThe total discounted amount applied to the cart.
    meta.display_price.discount.currencystringThe currency set for the amount.
    meta.display_price.discount.formattedstringThe formatted value for the discount.
    meta.display_price.without_discountobjectThe without_discount object describes amount, currency, formatted value of the cart without the discount.
    meta.display_price.without_discount.amountintegerThe total price applied to a cart without the discount.
    meta.display_price.without_discount.currencystringThe currency set for this cart.
    meta.display_price.without_discount.formattedintegerThe total formatted amount without the discount.
    meta.timestampsobjectTimestamps for this cart.
    meta.timestamps.created_atstringThe date this cart was created.
    meta.timestamps.expires_atstringThe date this cart will expire.
    meta.timestamps.updated_atstringThe date this cart was last updated.
    Previous
    Overview