Skip to main content

Get Cart Items

GET 

/v2/carts/:cartID/items

Use this endpoint to retrieve cart items. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs.

You can use this endpoint to retrieve the breakdown of cart items by promotion ID. For example, if you have Promotions Standard item discount with code sale2024, Rule Promotions item discount with code sale2024, and Rule Promotions cart discount with code sale2024, the discounts.constituents field in the response example will show the breakdown of the same promotion code used in both Promotions Standard and Rule Promotions.

"data": [
{
"id": "98de010d-dd10-4fa5-a070-0b9bcdc72974",
"type": "cart_item",
"product_id": "5a4662d2-9a2b-4f6e-a215-2970db914b0c",
"name": "sku1",
"description": "sku1",
"sku": "sku1",
"slug": "sku1",
"image": {
"mime_type": "",
"file_name": "",
"href": ""
},
"quantity": 1,
"manage_stock": false,
"unit_price": {
"amount": 10000,
"currency": "USD",
"includes_tax": false
},
"value": {
"amount": 10000,
"currency": "USD",
"includes_tax": false
},
"discounts": [
{
"amount": {
"amount": -2000,
"currency": "USD",
"includes_tax": false
},
"code": "sale2024",
"id": "e4d929d5-f471-4317-9a86-a84a6c572b44",
"promotion_source": "rule-promotion",
"is_cart_discount": true
},
{
"amount": {
"amount": -1000,
"currency": "USD",
"includes_tax": false
},
"code": "sale2024",
"id": "de19a043-a6da-4bde-b896-d17e16b77e25",
"promotion_source": "rule-promotion"
},
{
"amount": {
"amount": -1000,
"currency": "USD",
"includes_tax": false
},
"code": "sale2024",
"id": "509295ee-2971-45b6-801e-95df09756989"
},
{
"amount": {
"amount": -1000,
"currency": "USD",
"includes_tax": false
},
"code": "sale2024",
"id": "ca79e606-7ecd-41ac-9478-af4c8c28c546",
"promotion_source": "rule-promotion",
"is_cart_discount": true
}
],
"links": {
"product": "https://useast.api.elasticpath.com/v2/products/5a4662d2-9a2b-4f6e-a215-2970db914b0c"
},
"meta": {
"display_price": {
"with_tax": {
"unit": {
"amount": 5000,
"currency": "USD",
"formatted": "$50.00"
},
"value": {
"amount": 5000,
"currency": "USD",
"formatted": "$50.00"
}
},
"without_tax": {
"unit": {
"amount": 5000,
"currency": "USD",
"formatted": "$50.00"
},
"value": {
"amount": 5000,
"currency": "USD",
"formatted": "$50.00"
}
},
"tax": {
"unit": {
"amount": 0,
"currency": "USD",
"formatted": "$0.00"
},
"value": {
"amount": 0,
"currency": "USD",
"formatted": "$0.00"
}
},
"discount": {
"unit": {
"amount": -5000,
"currency": "USD",
"formatted": "-$50.00"
},
"value": {
"amount": -5000,
"currency": "USD",
"formatted": "-$50.00"
}
},
"without_discount": {
"unit": {
"amount": 10000,
"currency": "USD",
"formatted": "$100.00"
},
"value": {
"amount": 10000,
"currency": "USD",
"formatted": "$100.00"
}
},
"discounts": {
"sale2024": {
"amount": -5000,
"currency": "USD",
"formatted": "-$50.00",
"constituents": {
"509295ee-2971-45b6-801e-95df09756989": {
"amount": -1000,
"currency": "USD",
"formatted": "-$10.00"
},
"ca79e606-7ecd-41ac-9478-af4c8c28c546": {
"amount": -1000,
"currency": "USD",
"formatted": "-$10.00"
},
"de19a043-a6da-4bde-b896-d17e16b77e25": {
"amount": -1000,
"currency": "USD",
"formatted": "-$10.00"
},
"e4d929d5-f471-4317-9a86-a84a6c572b44": {
"amount": -2000,
"currency": "USD",
"formatted": "-$20.00"
}
}
}
}
},
"timestamps": {
"created_at": "2024-05-24T18:00:58Z",
"updated_at": "2024-05-24T18:00:58Z"
}
},
"catalog_id": "09b9359f-897f-407f-89a2-702e167fe781",
"catalog_source": "pim"
}

Request

Path Parameters

    cartID stringrequired

    The unique identifier of the cart that you created.

Responses

Response Headers
    Schema
      data object[]
    • Array [
    • anyOf
      data object
      type stringrequired

      Possible values: [cart_item]

      The type of object being returned.

      quantity numberrequired

      The number of items added to the cart.

      id uuid

      Specifies the ID of the product you want to add to cart. (use this OR sku)

      sku string

      Specifies the item SKU that you want to add to cart. (use this OR id)

      custom_inputs object

      The custom text to be added to a product.

      bundle_configuration object

      Object used to describe the bundle options selected.

      selected_options object

      Specifies selected options.

      component_products array

      Array of component products for the selected options.

      shipping_group_id string

      Identifier for a created Cart Shipping Group

      product_id uuid

      The unique ID of the product.

      subscription_offering_id uuid

      The unique ID of the subscription offering for subscription items.

      name string

      The name of this item

      description string

      A description of the cart item.

      catalog_id uuid

      The unique identifier of the catalog associated with the product is shown if catalog_source=pim is set.

      catalog_source string

      The catalog source. Always pim or legacy.

      image object
      mime_type string

      The MIME type for the uploaded file.

      file_name string

      The name of the image file that was uploaded.

      href string

      The link to the image.

      manage_stock boolean
      unit_price object
      amount number

      The amount for this item as an integer.

      currency string

      The currency this item was added to the cart as.

      includes_tax boolean

      Whether or not this price is tax inclusive.

      value object
      amount number

      The amount for this item as an integer.

      currency string

      The currency this item was added to the cart as.

      includes_tax boolean

      Whether or not this price is tax inclusive.

      links object
      product string

      A URL related to the resource.

      meta object
      display_price object
      with_tax object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      without_tax object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      tax object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      discount object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      without_discount object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      timestamps object
      created_at string

      The date this was created.

      updated_at

      The date this was last updated.

    • ]
    • meta object
      display_price object
      with_tax object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      without_tax object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      tax object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      discount object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      without_discount object
      amount number

      The raw total of this cart.

      currency string

      The currency set for this cart.

      formatted string

      The tax inclusive formatted total based on the currency.

      discounts object
      property name* object
      amount number
      currency string
      formatted string
      timestamps object
      created_at string
      updated_at
      expires_at
    Loading...