younifyd
Menu

Update A Cart Item

Update a Cart Item

PUT/v2/carts/{cartID}/items/{cartitemID}

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Update A Cart Item action (under Carts).
  3. Fill in the fields below, then reference the result from later steps as {{updateACartItem.response.data}}.

Request

Path parameters

cartIDstringrequired

A unique identifier of the cart that you created.

cartitemIDstringrequired

A unique identifier of the cart item.

Response

Returns 200 with an object. Read it in later steps with {{updateACartItem.response.data.<field>}}.

dataarray<object>
idstring (uuid)

The unique identifier for the cart item.

typestring

The type of cart item.

One ofcart_itemcustom_itemsubscription_itempromotion_item

product_idstring (uuid)

The unique ID of the product (for cart_item type).

promotion_idstring (uuid)

The unique ID of the promotion (for promotion_item type).

subscription_offering_idstring (uuid)

The unique ID of the subscription offering for subscription items.

namestring

The name of this item

descriptionstring

A description of the cart item.

skustring

The SKU of the cart item.

slugstring

The slug of the cart item.

catalog_idstring (uuid)

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

catalog_sourcestring

The catalog source. Always `pim` or `legacy`.

bundle_configurationobject2 fields

Configuration for bundle products.

componentsobject

Components of the cart item for bundle products.

imageobject3 fields
quantityinteger

The quantity of the cart item.

auto_add_quantityinteger

The quantity automatically added (for gift items).

manage_stockboolean

Whether or not the quantity of the item will be checked against inventory.

unit_priceobject3 fields
valueobject3 fields
discountsarray<object>7 fields

Array of discounts applied to the cart item.

custom_inputsobject

Custom inputs for personalized products.

subscription_configurationobject2 fields

Configuration for subscription items.

linksobject2 fields
metaobject2 fields
relationshipsobject3 fields

Relationships to other resources.

shipping_group_idstring

The shipping group ID for this item.

promotion_sourcestring

The source of the promotion (for promotion items).

One ofrule-promotion

promotion_action_idstring

The action ID within the rule promotion that produced this promotion item.

locationstring

The stock location for this item.

custom_attributesobject

Specifies custom attributes for cart or order objects. Each attribute includes a top-level key, as well as corresponding type and value entries. Attribute values must correspond to the assigned types. Example: ``` "custom_attributes": { "is_member": { "type": "boolean", "value": true }, "membership_level": { "type": "string", "value": "premium" } } ```

includedobject

Related objects that are included in the response.

custom_discountsarray<object>8 fields
promotionsarray<object>9 fields
tax_itemsarray<object>7 fields

Array of tax items included in the response.

metaobject

Additional meta information about the cart items collection.

display_priceobject10 fields
timestampsobject3 fields
messagesarray<object>3 fields

Optional array of informational messages that provide feedback about operations performed on the cart items, such as promotions added or discounts applied. This field is only present when there are relevant messages to display.

promotion_suggestionsarray<object>7 fields

Array of promotion suggestions

errorsarray<object>

Array of error objects, if any errors occurred.

titlestringrequired

A brief summary of the error.

statusstring | integerrequired

The HTTP response code of the error.

detailstring

Optional additional detail about the error.

sourcestring

The field or location that caused the validation error. For JSON schema validation errors, this contains the JSON path to the invalid field (e.g., 'data.name', 'request', 'data.items[0].quantity').

metaobject13 fields

Additional metadata associated with the error. May include arbitrary keys.

json
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "cart_item",
      "product_id": "00000000-0000-0000-0000-000000000000",
      "promotion_id": "00000000-0000-0000-0000-000000000000",
      "subscription_offering_id": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "description": "string",
      "sku": "string",
      "slug": "string",
      "catalog_id": "00000000-0000-0000-0000-000000000000",
      "catalog_source": "string",
      "bundle_configuration": {
        "selected_options": {},
        "component_products": [
          {
            "id": "string",
            "type": "string",
            "attributes": {},
            "meta": {},
            "price": {},
            "relationships": {}
          }
        ]
      }
    }
  ],
  "included": {
    "custom_discounts": [
      {
        "type": "string",
        "id": "00000000-0000-0000-0000-000000000000",
        "external_id": "string",
        "discount_engine": "string",
        "amount": {
          "amount": 0,
          "currency": "string",
          "formatted": "string"
        },
        "description": "string",
        "discount_code": "string",
        "relationships": {
          "item": {
            "data": {
              "id": null,
              "type": null
            }
          }
        }
      }
    ],
    "promotions": [
      {
        "automatic": false,
        "description": "string",
        "end": "2025-01-01T00:00:00Z",
        "id": "00000000-0000-0000-0000-000000000000",
        "name": "string",
        "promotion_type": "string",
        "promotion_source": "string",
        "start": "2025-01-01T00:00:00Z",
        "type": "string"
      }
    ],
    "tax_items": [
      {
        "type": "string",
        "id": "00000000-0000-0000-0000-000000000000",
        "jurisdiction": "string",
        "code": "string",
        "name": "string",
        "rate": 0,
        "amount": 0
      }
    ]
  },
  "meta": {
    "display_price": {
      "with_tax": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "without_tax": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "tax": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "discount": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "without_discount": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "shipping": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "shipping_discount": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "authorized": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "balance_owing": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      },
      "paid": {
        "amount": 0,
        "currency": "string",
        "formatted": "string"
      }
    },
    "timestamps": {
      "created_at": "string",
      "updated_at": "string",
      "expires_at": "string"
    },
    "messages": [
      {
        "title": "string",
        "description": "string",
        "source": {
          "type": "string",
          "id": "string",
          "code": "string"
        }
      }
    ],
    "promotion_suggestions": [
      {
        "bundle": [
          {
            "auto_add_free_gift": false,
            "cart_item_id": "string",
            "quantity": 0,
            "targets": [
              null
            ]
          }
        ],
        "code": "string",
        "info": "string",
        "message": "string",
        "promotion_id": "string",
        "auto_add": false,
        "targets": [
          {
            "cart_item_id": "string",
            "quantity": 0,
            "skus": [
              null
            ]
          }
        ]
      }
    ]
  },
  "errors": [
    {
      "title": "string",
      "status": "string",
      "detail": "string",
      "source": "string",
      "meta": {
        "id": "string",
        "ids": [
          "string"
        ],
        "item_ids": [
          "string"
        ],
        "shipping_group_id": "string",
        "shipping_group_ids": [
          "string"
        ],
        "cart_id": "string",
        "code": "string",
        "order_id": "string",
        "sku": "string",
        "email": "name@example.com",
        "component_product_id": "00000000-0000-0000-0000-000000000000",
        "error-meta-key": "string"
      }
    }
  ]
}

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.

Update A Cart Item — Elastic Path — Documentation