Skip to main content

POST Confirm Cart Items

Allows the partner to confirm the successful purchase of items. Rokt will then inform the relevant provider of the products for fulfillment.

Description#

After the payment is processed for all the items in the cart. Rokt advises that this is called for all purchase events, including on all platforms, devices, environments (web/app), countries, and channels.

Sample request #1:#

POST /v1/cart/confirm{    "cartId": "1580265846172",    "orderId": "1580265885747",    "items": [        {            "cartItemId": "30d0a389-5f63-4e20-9553-13ff40f8b11c",            "itemReservationId": "rokt_item_reservation_id.63a94103-75da-4d71-8c14-84674d286b98"        }    ]}

Sample request #2:#

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

items collection should at least contain either

- `cartItemId` and `itemReservationId` or- `cartItemId` and `quantity`

Request#

Path

POST /v1/cart/confirm

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. Optional on when no items included (sessionId generated if not provided). ca75f48-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",  "orderId": "string",  "items": [    {      "cartItemId": "string",      "itemReservationId": "string",      "quantity": 0    }  ],  "payPalOrderId": "string",  "merchantId": "string",  "attributes": {    "attribute": "string"  }}

Response#

200 OK

{  "cartId": "string",  "orderId": "string",  "items": [    {      "cartItemId": "string",      "itemReservationId": "string",      "itemConfirmationId": "string",      "itemConfirmationUrl": "string",      "success": true    }  ]}

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?