younifyd
Menu

Update A Cart

Update a Cart

PUT/v2/carts/{cartID}

Use it in a workflow

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

Request

Path parameters

cartIDstringrequired

The unique identifier of a cart created by you.

Request body

Enter the body as JSON in the step's Body field.

dataobject
descriptionstring

The cart description.

discount_settingsobject2 fields
inventory_settingsobject1 fields
item_settingsobject1 fields
namestring

The cart name provided by the shopper. A cart name must contain 1 to 255 characters. You cannot use whitespace characters, but special characters are permitted. For more information, see the [Safe Characters](/guides/Getting-Started/safe-characters) section.

contactobject1 fields
snapshot_datestring

This optional parameter sets a reference date for the cart. If this parameter is set, it allows the cart to act as one that might occur on that specified date. For example, such future carts might acquire future-enabled discounts, allowing users to test and validate future interactions with carts. The snapshot_date must be in the format 2026-02-21T15:07:25Z. By default, this parameter is left empty.

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" } } ```

payment_intent_idstring

To remove the Stripe payment intent from a cart, pass the empty value in the `payment_intent_id` field. You must use an empty value for this field. You cannot use this endpoint to directly update the cart to use an existing Payment Intent.

json
{
  "data": {
    "description": "string",
    "discount_settings": {
      "custom_discounts_enabled": false,
      "use_rule_promotions": false
    },
    "inventory_settings": {
      "defer_inventory_check": false
    },
    "item_settings": {
      "separate_items_by_location": false
    },
    "name": "string",
    "contact": {
      "email": "name@example.com"
    },
    "snapshot_date": "string",
    "custom_attributes": {},
    "payment_intent_id": "string"
  }
}

Response

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

dataany
includedobject

Related objects that are included in the response.

custom_discountsarray<object>8 fields
promotionsarray<object>9 fields
metaobject

Additional metadata for the cart response.

payment_intentobject

Payment intent details with nested structure including status and other Stripe payment intent fields

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": null,
  "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": [
      {
        "type": "string",
        "id": "00000000-0000-0000-0000-000000000000",
        "name": "string",
        "description": "string",
        "automatic": false,
        "promotion_type": "string",
        "promotion_source": "string",
        "start": "2025-01-01T00:00:00Z",
        "end": "2025-01-01T00:00:00Z"
      }
    ]
  },
  "meta": {
    "payment_intent": {}
  },
  "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.