Skip to main content

POST Reserve Cart Items

Allows the partner to reserve/hold the items for a set period of time during which the purchase must be completed and confirmed with Rokt. This allows partners to ensure stock and the price is locked in for the reservation duration.

Description#

When the user has finalized selection of catalog items but hasn’t paid yet. Reserving the cart items ensures supply of stock and locks in the price as per the returned values.

Sample request

POST /v1/cart/reserve{    "cartId": "1580265846172",    "items": [        {            "cartItemId": "30d0a389-5f63-4e20-9553-13ff40f8b11c",            "quantity": 1        }    ]}

Request#

Path

POST /v1/cart/reserve

Parameters

NameInDescriptionRequiredExample
rokt-api-keyheaderAPI authentication keytrueskeletonkey
Content-TypeheaderMedia type of request, 'application/json' is the only supported value at the moment application/json
AcceptheaderExpected media type of response, 'application/json' is the only supported value at the moment application/json
rokt-session-idheaderSessionId used by Rokt internally for tracking, referral, logging and debugging.trueca75f48-ebbd-4d8e-83c3-fdd70893294d
rokt-tag-idheaderUnique Rokt Tag IDtrue253_439d21r21r21321
Accept-LanguageheaderExpected locale of the consumer. This can be the full locale including language and country, or a neutral locale which only has the language. When locale is specified only placements and offers that match the locale are included for consideration. en-US

Request body

{  "cartId": "string",  "items": [    {      "cartItemId": "string",      "quantity": 0    }  ],  "isPayPalPayment": true,  "merchantId": "string",  "attributes": {    "attribute": "string"  }}

Response#

200 OK

{  "cartId": "string",  "items": [    {      "cartItemId": "string",      "itemReservationId": "string",      "quantity": 0,      "unitPrice": 0,      "totalPrice": 0,      "currency": "string",      "expirationDateTimeUtc": "2025-10-04T10:00:00.000Z",      "success": true    }  ],  "payPalOrderId": "string"}

Error#

400 BadRequest

{  "description": "string",  "errors": [    {      "code": "string",      "message": "string",      "value": {}    }  ]}

401 Unauthorized

403 Forbidden

{  "description": "string",  "errors": [    {      "code": "string",      "message": "string",      "value": {}    }  ]}

422 UnprocessableEntity

{  "description": "string",  "errors": [    {      "code": "string",      "message": "string",      "value": {}    }  ]}

500 InternalServerError

{  "description": "string",  "errors": [    {      "code": "string",      "message": "string",      "value": {}    }  ]}

504 GatewayTimeout

{  "description": "string",  "errors": [    {      "code": "string",      "message": "string",      "value": {}    }  ]}
Was this article helpful?