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
Name | Type | In | Description | Required | Example |
---|---|---|---|---|---|
rokt-api-key | header | API authentication key | true | skeletonkey | |
Content-Type | header | Media type of request, 'application/json' is the only supported value at the moment | application/json | ||
Accept | header | Expected media type of response, 'application/json' is the only supported value at the moment | application/json | ||
rokt-session-id | header | SessionId used by Rokt internally for tracking, referral, logging and debugging. | true | ca75f48-ebbd-4d8e-83c3-fdd70893294d | |
rokt-tag-id | header | Unique Rokt Tag ID | true | 253_439d21r21r21321 | |
Accept-Language | header | Expected 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"
}
}
Object { }
cartId: String
items: Array [
Object { }
] cartItemId: String
quantity: Number
isPayPalPayment: Boolean
merchantId: String
attributes: Object { }
[string]: String
Response
200 OK
{
"cartId": "string",
"items": [
{
"cartItemId": "string",
"itemReservationId": "string",
"quantity": 0,
"unitPrice": 0,
"totalPrice": 0,
"currency": "string",
"expirationDateTimeUtc": "2021-01-22T00:44:38.424Z",
"success": true
}
],
"payPalOrderId": "string"
}
Object { }
cartId: String
items: Array [
Object { }
] cartItemId: String
itemReservationId: String
quantity: Number
unitPrice: Number
totalPrice: Number
currency: String
expirationDateTimeUtc: Date
success: Boolean
payPalOrderId: String
Error
400 BadRequest
{
"description": "string",
"errors": [
{
"code": "string",
"message": "string",
"value": {}
}
]
}
Object { }
description: String
errors: Array [
Object { }
] code: String
message: String
value: Object {}
401 Unauthorized
403 Forbidden
{
"description": "string",
"errors": [
{
"code": "string",
"message": "string",
"value": {}
}
]
}
Object { }
description: String
errors: Array [
Object { }
] code: String
message: String
value: Object {}
422 UnprocessableEntity
{
"description": "string",
"errors": [
{
"code": "string",
"message": "string",
"value": {}
}
]
}
Object { }
description: String
errors: Array [
Object { }
] code: String
message: String
value: Object {}
500 InternalServerError
{
"description": "string",
"errors": [
{
"code": "string",
"message": "string",
"value": {}
}
]
}
Object { }
description: String
errors: Array [
Object { }
] code: String
message: String
value: Object {}
504 GatewayTimeout
{
"description": "string",
"errors": [
{
"code": "string",
"message": "string",
"value": {}
}
]
}
Object { }
description: String
errors: Array [
Object { }
] code: String
message: String
value: Object {}