Composable Frontend 2.0 Learn more 

  • Commerce Cloud/
    Carts/
    Cart Items/
    Cart Items Overview

    Cart Items Overview

    The Cart Item Object

    Products added to a cart are referred to as a cart_item.

    The bundle_configuration object was misspelled in the cart, cart items, and order items. Therefore, on October 18, 2022, we have deprecated bundle_configuation(misspelled) and recommend that you use bundle_configuration to create a bundle configuration.

    AttributeTypeDescription
    idstringThe unique identifier for this cart item.
    typestringcart_item, custom_item or promotion_item
    namestringThe name of this item.
    descriptionstringA description of the cart item.
    skustringThe SKU code for the item.
    imageobjectThe product image.
    quantityintegerNumber of items added to the cart.
    custom_inputsobjectThe custom text to be added to a product.
    unit_priceobjectThe pricing information about a single instance of this item.
    discountsobjectThe list of all promotion codes and corresponding discount amount applied for the item
    valueobjectThe pricing information and total value of this item line based on the quantity.
    linksobjectA collection of URLs related to this resource.
    componentsobjectThe bundle name, id, type, and quantity.
    bundle_configurationobjectThe list of all the selected_options.
    metaobjectAdditional information calculated for this cart.
    catalog_sourcestringThe catalog source. Always pim or legacy.
    catalog_idobjectThe unique identifier of the catalog associated with the product is shown if catalog_source=pim is set.

    Response Example

    {
        "data": [
            {
                "id": "f003b967-6d12-4289-8d39-4451ea0ea17a",
                "type": "cart_item",
                "product_id": "ed9faf9e-d131-44e9-ac60-9a4037c9bd09",
                "name": "nested bundle",
                "description": "nested bundle",
                "sku": "nested-bundle",
                "slug": "nested-bundle",
                "image": {
                    "mime_type": "",
                    "file_name": "",
                    "href": ""
                },
                "quantity": 1,
                "manage_stock": false,
                "unit_price": {
                    "amount": 9999,
                    "currency": "USD",
                    "includes_tax": false
                },
                "value": {
                    "amount": 9999,
                    "currency": "USD",
                    "includes_tax": false
                },
                "discounts": [
                    {
                        "amount": {
                            "amount": -1000,
                            "currency": "USD",
                            "includes_tax": false
                        },
                        "code": "nested-bundle_10",
                        "id": "c2d58e64-aaf0-4780-bd1e-6bdbcbacdd74"
                    }
                ],
                "components": {
                    "component 2": {
                        "name": "component 2",
                        "options": [
                            {
                                "id": "7d28f075-0110-4cd4-8d58-15cda55c8b5b",
                                "type": "product",
                                "quantity": 1
                            }
                        ]
                    },
                    "component1": {
                        "name": "component1",
                        "options": [
                            {
                                "id": "3a16e947-fcb1-4673-b5a9-8b0778b08f5c",
                                "type": "product",
                                "quantity": 1
                            },
                            {
                                "id": "bd139213-3cd0-4bc5-bcd4-bd74adf00db2",
                                "type": "product",
                                "quantity": 1
                            }
                        ]
                    }
                },
                "bundle_configuration": {
                    "selected_options": {
                        "component 2": {
                            "7d28f075-0110-4cd4-8d58-15cda55c8b5b": 1
                        },
                        "component1": {
                            "3a16e947-fcb1-4673-b5a9-8b0778b08f5c": 1
                        }
                    }
                },
                "links": {
                    "product": "https://useast.api.elasticpath.com/v2/products/ed9faf9e-d131-44e9-ac60-9a4037c9bd09"
                },
                "meta": {
                    "display_price": {
                        "with_tax": {
                            "unit": {
                                "amount": 7999,
                                "currency": "USD",
                                "formatted": "$79.99"
                            },
                            "value": {
                                "amount": 7999,
                                "currency": "USD",
                                "formatted": "$79.99"
                            }
                        },
                        "without_tax": {
                            "unit": {
                                "amount": 7999,
                                "currency": "USD",
                                "formatted": "$79.99"
                            },
                            "value": {
                                "amount": 7999,
                                "currency": "USD",
                                "formatted": "$79.99"
                            }
                        },
                        "tax": {
                            "unit": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            },
                            "value": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            }
                        },
                        "discount": {
                            "unit": {
                                "amount": -2000,
                                "currency": "USD",
                                "formatted": "-$20.00"
                            },
                            "value": {
                                "amount": -2000,
                                "currency": "USD",
                                "formatted": "-$20.00"
                            }
                        },
                        "without_discount": {
                            "unit": {
                                "amount": 9999,
                                "currency": "USD",
                                "formatted": "$99.99"
                            },
                            "value": {
                                "amount": 9999,
                                "currency": "USD",
                                "formatted": "$99.99"
                            }
                        },
                        "discounts": {
                            "nested-bundle_10": {
                                "amount": -1000,
                                "currency": "USD",
                                "formatted": "-$10.00"
                            }
                        }
                    },
                    "timestamps": {
                        "created_at": "2022-10-19T20:42:23Z",
                        "updated_at": "2022-10-19T20:42:23Z"
                    }
                },
                "catalog_id": "09b9359f-897f-407f-89a2-702e167fe781",
                "catalog_source": "pim"
            },
            {
                "id": "8561c752-9e6a-480c-b02f-57563144af36",
                "type": "promotion_item",
                "promotion_id": "24f50e56-b229-46ad-8ab6-eb0b8d51429f",
                "name": "$10 off your order!",
                "description": "Promotion",
                "sku": "10off",
                "slug": "",
                "image": {
                    "mime_type": "",
                    "file_name": "",
                    "href": ""
                },
                "quantity": 1,
                "manage_stock": false,
                "unit_price": {
                    "amount": -1000,
                    "currency": "USD",
                    "includes_tax": false
                },
                "value": {
                    "amount": -1000,
                    "currency": "USD",
                    "includes_tax": false
                },
                "links": {},
                "meta": {
                    "display_price": {
                        "with_tax": {
                            "unit": {
                                "amount": -1000,
                                "currency": "USD",
                                "formatted": "-$10.00"
                            },
                            "value": {
                                "amount": -1000,
                                "currency": "USD",
                                "formatted": "-$10.00"
                            }
                        },
                        "without_tax": {
                            "unit": {
                                "amount": -1000,
                                "currency": "USD",
                                "formatted": "-$10.00"
                            },
                            "value": {
                                "amount": -1000,
                                "currency": "USD",
                                "formatted": "-$10.00"
                            }
                        },
                        "tax": {
                            "unit": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            },
                            "value": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            }
                        },
                        "discount": {
                            "unit": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            },
                            "value": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            }
                        },
                        "without_discount": {
                            "unit": {
                                "amount": 0,
                                "currency": "",
                                "formatted": "0"
                            },
                            "value": {
                                "amount": 0,
                                "currency": "",
                                "formatted": "0"
                            }
                        }
                    },
                    "timestamps": {
                        "created_at": "2022-10-19T20:43:06Z",
                        "updated_at": "2022-10-19T21:01:58Z"
                    }
                }
            }
        ],
        "meta": {
            "display_price": {
                "with_tax": {
                    "amount": 7999,
                    "currency": "USD",
                    "formatted": "$79.99"
                },
                "without_tax": {
                    "amount": 7999,
                    "currency": "USD",
                    "formatted": "$79.99"
                },
                "tax": {
                    "amount": 0,
                    "currency": "USD",
                    "formatted": "$0.00"
                },
                "discount": {
                    "amount": -2000,
                    "currency": "USD",
                    "formatted": "-$20.00"
                },
                "without_discount": {
                    "amount": 9999,
                    "currency": "USD",
                    "formatted": "$99.99"
                }
            },
            "timestamps": {
                "created_at": "2022-10-19T20:42:23Z",
                "updated_at": "2022-10-19T21:01:58Z",
                "expires_at": "2022-10-26T21:01:58Z"
            }
        }
    }
    

    The Cart Item image Object

    The image object is empty if there is no main image assigned.

    AttributeTypeDescription
    file_namestringThe name of the image file that was uploaded.
    mime_typestringThe MIME type for the uploaded file.
    hrefstringThe link to the image.

    The Cart Item unit_price Object

    AttributeTypeDescription
    unit_price.amountintegerThe singular price of this item as an integer.
    unit_price.currencystringThe currency this item was added to the cart as.
    unit_price.includes_taxbooleanWhether or not this price is tax inclusive.

    The Cart Item discounts Object

    AttributeTypeDescription
    discounts.amount.amountintegerThe discount amount for this item.
    discounts.amount.currencystringThe currency for this item.
    discounts.amount.includes_taxstringIs the discount inclusive of tax?
    discounts.codestringThe discount code.
    discounts.idstringThe unique identifier of the promotion.

    The Cart Item value Object

    AttributeTypeDescription
    value.amountintegerThe total price for this item line (quantity * unit_price.amount).
    value.currencystringThe currency this item was added to the cart as.
    value.includes_taxbooleanWhether or not this price is tax inclusive.
    AttributeTypeDescription
    links.productstringA link to the product this cart item is a snapshot of (not for custom_items).
    value.currencystringThe currency this item was added to the cart as.

    The Cart Item components Object

    AttributeTypeDescription
    components.namestringThe component name. The component name is the name that is displayed in your storefront.
    components.optionsarrayThe product options that make up this component.
    components.options.idstringThe unique Id of the product you want to add to their component.
    components.options.typestringMust be always product.
    components.options.quantitystringThe number of this product option that a shopper must purchase.

    The Cart Item bundle_configuration Object

    AttributeTypeDescription
    bundle_configuration.selected_optionsobjectThe components a shopper has selected options from in a dynamic bundle.

    The Cart Item meta Object

    AttributeTypeDescription
    meta.display_priceobjectA collection of fields related to the totals and currency of this cart item.
    meta.display_price.with_taxobjectTax inclusive totals.
    meta.display_price.with_tax.unitobjectTax inclusive totals for a single instance of this cart item.
    meta.display_price.with_tax.unit.amountintegerThe raw price of a single instance of this cart item (inc tax).
    meta.display_price.with_tax.unit.currencystringThe currency set for this cart item.
    meta.display_price.with_tax.unit.formattedstringThe tax inclusive formatted total of a single instance of this cart item based on the currency.
    meta.display_price.with_tax.valueobjectTax inclusive totals for this cart item based on the quantity.
    meta.display_price.with_tax.value.amountintegerThe raw total price of this cart item line (inc tax).
    meta.display_price.with_tax.value.currencystringThe currency set for this cart item.
    meta.display_price.with_tax.value.formattedstringThe tax inclusive formatted total of this cart item line based on the currency.
    meta.display_price.without_taxobjectTax exclusive totals.
    meta.display_price.without_tax.unitobjectTax exclusive totals for a single instance of this cart item.
    meta.display_price.without_tax.unit.amountintegerThe raw price of a single instance of this cart item (ex tax).
    meta.display_price.without_tax.unit.currencystringThe currency set for this cart item.
    meta.display_price.without_tax.unit.formattedstringThe tax exclusive formatted total of a single instance of this cart item based on the currency.
    meta.display_price.without_tax.valueobjectTax exclusive totals for this cart item based on the quantity.
    meta.display_price.without_tax.value.amountintegerThe raw total price of this cart item line (ex tax).
    meta.display_price.without_tax.value.currencystringThe currency set for this cart item.
    meta.display_price.without_tax.value.formattedstringThe tax inclusive formatted total of this cart item line based on the currency.
    meta.display_price.taxobjectTax totals.
    meta.display_price.tax.unitobjectTax totals for a single instance of this cart item.
    meta.display_price.tax.unit.amountintegerThe subtotal of the added tax value for a single instance of this cart item.
    meta.display_price.tax.unit.currencystringThe currency set for the tax.
    meta.display_price.tax.unit.formattedstringThe formatted value for the tax subtotal.
    meta.display_price.tax.valueobjectTax totals for this cart item based on the quantity.
    meta.display_price.tax.value.amountintegerThe subtotal of the added tax value.
    meta.display_price.tax.value.currencystringThe currency set for the tax.
    meta.display_price.tax.value.formattedstringThe formatted value for the tax subtotal.
    meta.display_price.discountobjectThe discount object describes the unit discount value and total discount value.
    meta.display_price.discount.unitobjectThe unit object specifies the amount, currency, and formatted value of the total discounted amount applied to a unit item.
    meta.display_price.discount.unit.amountintegerThe discounted amount applied to an individual unit item.
    meta.display_price.discount.unit.currencyintegerThe currency set for the cart item.
    meta.display_price.discount.unit.formattedstringThe formatted value of the total discounted amount applied to the individual unit item.
    meta.display_price.discount.valueobjectThe value object specifies the amount, currency, and formatted value of the total discounted amount applied to this cart based on the quantity.
    meta.display_price.discount.value.amountintegerThe total discounted amount applied to the cart item based on the quantity.
    meta.display_price.discount.value.currencystringThe currency set for the cart item.
    meta.display_price.discount.value.formattedstringThe formatted value of the total discounted amount applied to the cart item based on the quantity.
    meta.display_price.without_discountobjectThe without_discount object describes the unit value and total value of the cart without the discount.
    meta.display_price.without_discount.unitobjectThe unit object specifies the amount, currency, and formatted value applied to a unit item without the discount.
    meta.display_price.without_discount.unit.amountintegerThe total price applied to a unit item without the discount.
    meta.display_price.without_discount.unit.currencystringThe currency set for this cart item.
    meta.display_price.without_discount.unit.formattedintegerThe total formatted amount for this item without the discount.
    meta.display_price.without_discount.valueobjectThe value object specifies the amount, currency, and formatted value of the cart item without the discount based on the quantity.
    meta.display_price.without_discount.value.amountintegerThe total amount applied to the cart item without the discount based on the quantity.
    meta.display_price.without_discount.value.currencystringThe currency set for this cart item.
    meta.display_price.without_discount.value.formattedstringThe total amount applied to the cart item without the discount based on the quantity.
    meta.display_price.discountsobjectThe list of all promotion codes and corresponding discount amount applied for the item.
    meta.display_price.discounts.amountintegerThe discounted amount applied to the individual item.
    meta.display_price.discounts.currencystringThe currency set for this cart item.
    meta.display_price.discounts.formattedstringThe formatted value of the discount amount applied for the individual item.
    meta.timestampsobjectTimestamps for this cart item.
    meta.timestamps.created_atstringThe creation date of this cart item.
    meta.timestamps.updated_atstringThe last updated date of this cart item.