> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withbenji.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Item to Cart

> Add one or more redeemable offers to a user's active cart

> [!NOTE]
>
> This endpoint requires both your **partner API key** in the `x-api-key` header and a Bearer token in the `Authorization` header. The Bearer token is the user access token obtained after a successful [Benji Connect SDK](https://docs.withbenji.com/connect/methods.md#onsuccess) `onSuccess` callback. See [Exchange Token](https://docs.withbenji.com/connect/exchange_token.md) and [API Authentication](https://docs.withbenji.com/api-reference/authentication.md). Partner API keys can be generated through the dashboard.

**x-api-key** `string` *required*

Your partner API key, generated through the dashboard. Required together with `Authorization`.

**Authorization** `string` *required*

A `Bearer` user access token obtained after the [Benji Connect SDK](https://docs.withbenji.com/connect/methods.md#onsuccess) `onSuccess` callback. Required together with `x-api-key`. See [Exchange Token](https://docs.withbenji.com/connect/exchange_token.md).

**user\_id** `integer` *required*

The Benji Platform identifier of the user who owns the cart.

**partner\_id** `integer` *required*

The Benji Platform identifier of the partner the cart belongs to. A user has one active cart per partner.

**partnership\_id** `integer` *required*

The identifier of the partnership the offer belongs to. It must match the partnership the `redemption_token` was issued for.

**redemption\_token** `string` *required*

The `redemption_token` returned for the offer by [Campaign Eligibility](https://docs.withbenji.com/api-reference/endpoint/campaigns/eligibility.md). This is the same token used by [Redeem by Token](https://docs.withbenji.com/api-reference/endpoint/transactions/redeem.md). It lasts 600 seconds (10 minutes), must have been issued for the same `user_id`, `partner_id`, and `partnership_id`, and cannot be empty. Adding an item to a cart does not consume the token.

**quantity** `integer` (default: 1)

The number of cart items to add for this offer. Must be an integer greater than or equal to 1. Each unit is stored as its own cart item.

**is\_gift** `integer`

Whether the added items are gifts. Must be `0` (for the user) or `1` (a gift). If you omit `is_gift` and the gift recipient fields, Benji fills personal slots first, up to the offer's personal limit, and marks the remaining units as gifts, up to the offer's gift limit.

**gift\_recipient\_name** `string`

The name of the gift recipient. Required, together with `gift_recipient_email`, whenever either recipient field is sent. A gift can be added with `is_gift` set to `1` and no recipient fields; the recipient must then be provided before the cart is validated.

**gift\_recipient\_email** `string`

The email address of the gift recipient. Must be a valid email address and cannot be blank when sent.

### Response

**cart** `object` *required*

The user's active cart after the items were added.

**properties**

**id** `string` *required*

UUID identifier of the cart.

**user\_id** `integer` *required*

The Benji Platform identifier of the user who owns the cart.

**partner\_id** `integer` *required*

The Benji Platform identifier of the partner the cart belongs to.

**status** `integer` *required*

Integer representing an enum of one of the following cart status values:

**possible cart status values**

* **ACTIVE (1)** : The cart is open and can be edited \\

* **CANCELLED (2)** : The cart was cancelled \\

* **CHECKED\_OUT (3)** : The cart was redeemed \\

**coupon\_code** `string`

The coupon code applied to the cart, if any.

**created\_date** `string`

The date and time when the cart was created, in ISO 8601 format.

**last\_item\_activity\_at** `string`

The date and time of the last change to the cart items, in ISO 8601 format.

**items** `array`

The items in the cart.

**cart item properties**

**id** `string` *required*

UUID identifier of the cart item.

**partnership\_id** `integer` *required*

The identifier of the partnership the offer belongs to.

**offer\_id** `string` *required*

The identifier of the offer.

**merchant\_id** `integer`

The identifier of the merchant that provides the offer.

**eligible\_price\_cents** `integer` *required*

The price of the item at the time it was added, taken from the `reward_amount` the redemption token was issued for.

**currency** `string`

The currency of the price. Defaults to `USD`.

**redemption\_token** `string` *required*

The redemption token the item was added with.

**eligibility\_campaign\_id** `integer`

The ID of the campaign the item was found eligible under.

**coupon\_id** `string`

The ID of the coupon applied to the item, if any.

**eligibility\_checked\_at** `string`

The date and time when the item was added to the cart, in ISO 8601 format.

**is\_gift** `integer` *required*

`1` if the item is a gift, `0` if it is for the user.

**is\_giftable** `integer` *required*

`1` if the offer can be gifted, `0` if it cannot.

**gift\_recipient\_name** `string`

The name of the item's recipient. For items that are not gifts, this defaults to the user's name when the user has a name and email on file.

**gift\_recipient\_email** `string`

The email address of the item's recipient. For items that are not gifts, this defaults to the user's email when the user has a name and email on file.

**created\_date** `string`

The date and time when the cart item was created, in ISO 8601 format.

```bash cURL theme={null}
curl --request POST \
  --url https://api-staging.withbenji.com/users/155/partners/61/cart/items \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <your-partner-api-key>' \
  --header 'Authorization: Bearer <user-access-token>' \
  --data '{
    "partnership_id": 42,
    "redemption_token": "3f6c0a52-8d1e-4f0b-9a57-0b6f2f7a7c11",
    "quantity": 1
  }'
```

```json 200 theme={null}
{
    "code": "ok",
    "data": {
        "cart": {
            "id": "b1c0f3a8-6c1e-4d52-9f7e-2a4d7b9e5c10",
            "user_id": 155,
            "partner_id": 61,
            "status": 1,
            "coupon_code": null,
            "created_date": "2026-12-02T15:04:11.482913+00:00",
            "last_item_activity_at": "2026-12-02T15:04:11.601227+00:00",
            "items": [
                {
                    "id": "0e8d1f7b-3a55-4c0a-8d3b-5f0c6a1e9d42",
                    "partnership_id": 42,
                    "offer_id": "sku-1",
                    "merchant_id": 93,
                    "eligible_price_cents": 450,
                    "currency": "USD",
                    "redemption_token": "3f6c0a52-8d1e-4f0b-9a57-0b6f2f7a7c11",
                    "eligibility_campaign_id": 118,
                    "coupon_id": null,
                    "eligibility_checked_at": "2026-12-02T15:04:11.590118+00:00",
                    "is_gift": 0,
                    "is_giftable": 1,
                    "gift_recipient_name": "Test User",
                    "gift_recipient_email": "test@test.com",
                    "created_date": "2026-12-02T15:04:11.598402+00:00"
                }
            ]
        }
    }
}
```

```json 400 theme={null}
{
  "code": "cart_missing_redemption_token_error",
  "message": "Missing redemption token."
}
```

```json 404 theme={null}
{
  "code": "resource_not_found_error",
  "message": "user 155 does not exist."
}
```

```json 409 theme={null}
{
  "code": "cart_redemption_token_scope_mismatch_error",
  "message": "Redemption token does not belong to the requested user or partner."
}
```

```json 409 theme={null}
{
  "code": "quantity_exceeds_purchase_limit",
  "message": "You've exceeded the allowed quantity for this offer."
}
```

```json 410 theme={null}
{
  "code": "cart_redemption_token_invalid_error",
  "message": "Redemption token is invalid, expired, or already consumed."
}
```

```json 422 theme={null}
{
  "code": "personal_limit_reached",
  "message": "You've reached the personal limit for this offer. Additional items must be gifts."
}
```

> [!TIP]
>
> The same redemption token can be added more than once to buy several units of one offer. After the cart is built, [Validate Cart](https://docs.withbenji.com/api-reference/endpoint/users/validate-cart.md) issues a `cart_redemption_token`. Pass that token to [Redeem Cart by Token](https://docs.withbenji.com/api-reference/endpoint/transactions/redeem-cart-by-token.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.