curl --request POST \
--url https://api-staging.withbenji.com/users/155/partners/61/cart/validate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-partner-api-key>' \
--header 'Authorization: Bearer <user-access-token>' \
--header 'X-Fingerprint-Visitor-Id: <fingerprint-visitor-id>' \
--header 'X-Fingerprint-Event-Id: <fingerprint-event-id>' \
--data '{}'
{
"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"
}
]
},
"cart_redemption_token": "8c2d7a14-5e0b-4b7f-a1d9-3e6f0c9b2a58"
}
}
{
"code": "cart_not_found_error",
"message": "cart user_id=155, partner_id=61 does not exist."
}
{
"code": "out_of_stock",
"message": "This cart item is out of stock.",
"offer_id": "sku-1"
}
{
"code": "cart_gift_validation_error",
"message": "This offer is not giftable."
}
{
"code": "cart_validation_eligibility_service_error",
"message": "Failed to validate cart eligibility for partnership_id=42"
}
Member API
Validate Cart
Re-check eligibility for every item in a user’s cart and issue a cart redemption token
POST
/
users
/
{user_id}
/
partners
/
{partner_id}
/
cart
/
validate
curl --request POST \
--url https://api-staging.withbenji.com/users/155/partners/61/cart/validate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-partner-api-key>' \
--header 'Authorization: Bearer <user-access-token>' \
--header 'X-Fingerprint-Visitor-Id: <fingerprint-visitor-id>' \
--header 'X-Fingerprint-Event-Id: <fingerprint-event-id>' \
--data '{}'
{
"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"
}
]
},
"cart_redemption_token": "8c2d7a14-5e0b-4b7f-a1d9-3e6f0c9b2a58"
}
}
{
"code": "cart_not_found_error",
"message": "cart user_id=155, partner_id=61 does not exist."
}
{
"code": "out_of_stock",
"message": "This cart item is out of stock.",
"offer_id": "sku-1"
}
{
"code": "cart_gift_validation_error",
"message": "This offer is not giftable."
}
{
"code": "cart_validation_eligibility_service_error",
"message": "Failed to validate cart eligibility for partnership_id=42"
}
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 onSuccess callback. See Exchange Token and API Authentication. Partner API keys can be generated through the dashboard.Your partner API key, generated through the dashboard. Required together with
Authorization.A
Bearer user access token obtained after the Benji Connect SDK onSuccess callback. Required together with x-api-key. See Exchange Token.The Fingerprint visitor ID of the device the cart owner is using. Send it together with
X-Fingerprint-Event-Id to register the device against the cart owner. Blank values are ignored.The Fingerprint event ID of the request that identified the device. Send it together with
X-Fingerprint-Visitor-Id. Blank values are ignored.The Benji Platform identifier of the partner the cart belongs to. A user has one active cart per partner.
Optional coupon code to apply while refreshing cart eligibility. If you omit this field, Benji uses the coupon already stored on the cart.
Optional list of campaign flow IDs the cart lines were priced against. When set, eligibility is restricted to these flows. Use this when more than one active flow could match the same offer.
Response
The user’s active cart after eligibility, prices, and item-level
redemption_token values have been refreshed. The object has the same shape as the cart returned by Add Item to Cart.A single-use token that authorizes redemption of every item currently in the cart. It lasts 600 seconds (10 minutes), the same as the perk
redemption_token returned by Campaign Eligibility. Pass this token to Redeem Cart by Token. It is not the perk redemption_token used by Add Item to Cart or Redeem by Token.curl --request POST \
--url https://api-staging.withbenji.com/users/155/partners/61/cart/validate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-partner-api-key>' \
--header 'Authorization: Bearer <user-access-token>' \
--header 'X-Fingerprint-Visitor-Id: <fingerprint-visitor-id>' \
--header 'X-Fingerprint-Event-Id: <fingerprint-event-id>' \
--data '{}'
{
"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"
}
]
},
"cart_redemption_token": "8c2d7a14-5e0b-4b7f-a1d9-3e6f0c9b2a58"
}
}
{
"code": "cart_not_found_error",
"message": "cart user_id=155, partner_id=61 does not exist."
}
{
"code": "out_of_stock",
"message": "This cart item is out of stock.",
"offer_id": "sku-1"
}
{
"code": "cart_gift_validation_error",
"message": "This offer is not giftable."
}
{
"code": "cart_validation_eligibility_service_error",
"message": "Failed to validate cart eligibility for partnership_id=42"
}
Validation fails the whole request if any cart item is ineligible, out of stock, over a purchase or gift limit, or is marked as a gift for an offer that is not giftable. No
cart_redemption_token is issued in that case.Build the cart first with Add Item to Cart, using the perk
redemption_token from Campaign Eligibility. Then call this endpoint to issue a cart_redemption_token, and pass that token to Redeem Cart by Token. The cart token lasts 600 seconds (10 minutes).Was this page helpful?