🔗 CheckoutCart Sessions

Update a line item's quantity

Change the quantity of a single line item on an open cart. Other fields on the line item are immutable; recreate the item to change them.

PATCH/cart-sessions/{id}/line-items/{lineId}

Change the quantity of a single line item on an open cart. Other fields on the line item are immutable; recreate the item to change them.


Related endpoints

  • POST /cart-sessions — Create a cart session
  • GET /cart-sessions/{id} — Retrieve a cart session
  • POST /cart-sessions/{id}/line-items — Add a line item to a cart session
  • DELETE /cart-sessions/{id}/line-items/{lineId} — Remove a line item from a cart session
  • POST /cart-sessions/{id}/add-ons — Toggle an add-on on a cart session
  • POST /cart-sessions/{id}/discount-code — Set or clear a cart discount code
  • POST /cart-sessions/{id}/contact — Capture customer email + consent on a cart
  • POST /cart-sessions/{id}/convert — Convert a cart session into a checkout session

Common errors

  • 400 invalid_request — malformed payload or failed validation.
  • 401 authentication_error — missing, invalid, expired, or revoked credential. Codes: authentication_failed, invalid_api_key, expired_api_key, api_key_revoked, session_invalid, merchant_required. Carries a WWW-Authenticate: Bearer challenge.
  • 404 resource_missing — the referenced resource does not exist or is not visible to your key.
  • 409 conflict — Idempotency-Key collision with a different body, or a concurrent state-transition conflict.

Idempotency

Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.

x-api-key<token>

Your RevKeen merchant API key. Create and manage keys in Dashboard → Settings → Developer. Use rk_sandbox_* for staging/test and rk_live_* for production. The same key may be sent as Authorization: Bearer <key> if that suits your HTTP client better. A missing, invalid, expired, or revoked key returns 401 with a WWW-Authenticate: Bearer challenge; a valid key without the required scope returns 403.

In: header

Path Parameters

id*string
Formatuuid
lineId*string

Cart line item id (the id field returned on cart_session.line_items[]).

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

Stuck on an error response? Ask the RevKeen assistant to explain it.
curl -X PATCH "https://api.revkeen.com/v2/cart-sessions/11111111-1111-4111-8111-111111111111/line-items/cli_550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: $REVKEEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "quantity": 2
  }'

Synthetic documentation data, validated against the response schema; not a live API result.

{  "data": {    "id": "00000000-0000-4000-8000-000000000001",    "object": "cart_session",    "merchant_id": "00000000-0000-4000-8000-000000000001",    "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",    "currency": "str",    "mode": "payment",    "status": "open",    "line_items": [      {        "id": "cli_550e8400-e29b-41d4-a716-446655440000",        "product_id": "00000000-0000-4000-8000-000000000001",        "name": "Example customer",        "quantity": 1,        "unit_price_minor": 0,        "currency": "str",        "recurring": {          "interval": "month",          "interval_count": 1        },        "billing_max_cycles": 1,        "trial_period_days": 0,        "start_rule": "immediate",        "billing_anchor_rule": "same_day",        "billing_anchor_day": 1,        "due_today_minor": 0,        "first_charge_minor": 0,        "first_renewal_at": "2019-08-24T14:15:22Z",        "effective_start_rule": "immediate",        "metadata": {          "property1": null,          "property2": null        }      }    ],    "add_ons_offered": [      "00000000-0000-4000-8000-000000000001"    ],    "add_ons_selected": [      "00000000-0000-4000-8000-000000000001"    ],    "discount_code": "string",    "email": "user@example.com",    "promotional_consent": true,    "sms_consent": true,    "subtotal_minor": 0,    "total_minor": 0,    "metadata": {      "property1": null,      "property2": null    },    "converted_to_checkout_session_id": "5d37f263-6519-4765-9535-e6aa5913d87c",    "public_token": "string",    "created_at": "2026-09-01T12:00:00Z",    "updated_at": "2026-09-01T12:00:00Z",    "expires_at": "2026-09-01T12:00:00Z"  }}

Put this endpoint to work