Checkout Basket Run in API Explorer
Ask AI
Creates a checkout session from a basket, leading to a payment intent based on the provided gateway.
POST
/commerce/{accountId}/v2/checkouts
curl \
--request POST 'https://api.staging.deliverect.com/commerce/{accountId}/v2/checkouts' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"basket":{"id":"string"},"note":"string","payments":[{"type":"dpay","externalId":"","isPrepaid":"true","amount":"","metadata":{}}],"order":{"channelOrderId":"string","channelOrderDisplayId":"string"}}'
Request examples
{
"basket": {
"id": "string"
},
"note": "string",
"payments": [
{
"type": "dpay",
"externalId": "",
"isPrepaid": "true",
"amount": "",
"metadata": {}
}
],
"order": {
"channelOrderId": "string",
"channelOrderDisplayId": "string"
}
}
Response examples (200)
Offline
{
"id": "694138133662b46bddf06e70",
"created": "2025-12-16T10:44:35.107000",
"updated": "2025-12-16T10:44:51.016000+00:00",
"deleted": false,
"etag": "2e94b59d6155094830af3362502fddc0cd51ef2f",
"accountId": "668cd58b6da5e4cec26f1f35",
"channelLinkId": "6911e9be1531637e9cf80a5f",
"storeId": "6911e9be1531637e9cf80a5f",
"status": "open",
"failureReason": null,
"basket": {
"id": "694138103662b46bddf06e6e",
"channel": 10165,
"category": {
"type": "restaurant"
},
"currency": "AED",
"taxExclusive": false,
"status": "open",
"items": [
{
"id": "694138103662b46bddf06e6f",
"menuId": "6882366cf04ece702e6661c8",
"plu": "STK-01",
"name": "Delicious Steak Frites",
"quantity": 1,
"price": 1500,
"gross": 1500,
"taxes": [],
"net": 1500,
"subItems": [
{
"customizationPlu": "MOD-01",
"plu": "COOK-01",
"name": "Rare",
"quantity": 1,
"price": 0,
"subItems": [],
"note": null
},
{
"customizationPlu": "MOD-02",
"plu": "SI-01",
"name": "Fries",
"quantity": 1,
"price": 0,
"subItems": [],
"note": null
}
],
"discounts": [],
"discountTotal": 0,
"note": "ITEM LEVEL NOTE"
}
],
"payment": {
"tips": [],
"discountsTotal": 0,
"chargesTotal": 0,
"taxTotal": 0,
"tipTotal": 0,
"subTotal": 1500,
"total": 1500
},
"customer": {
"name": "John Doe",
"companyName": "ACME",
"phoneNumber": "+32474081356",
"email": "john.doe@acme.com",
"externalId": "custom_channel_id_12345",
"loyaltyProviderCustomerId": null,
"tin": null
},
"fulfillment": {
"type": "eatIn",
"spot": "TABLE-1"
},
"taxes": [],
"discounts": [],
"charges": {
"serviceCharge": {
"value": 0,
"taxRate": 0,
"gross": 0,
"tax": 0,
"net": 0,
"type": "fixed"
},
"bagFee": {
"value": 0,
"taxRate": 0,
"gross": 0,
"tax": 0,
"net": 0
},
"deliveryFee": {
"value": 0,
"taxRate": 0,
"gross": 0,
"tax": 0,
"net": 0
},
"taxTotal": 0,
"netTotal": 0,
"grossTotal": 0
}
},
"payment": {
"id": "694138133662b46bddf06e71",
"gateway": 1,
"status": "authorized",
"action": {
"type": "offline",
"paid": true
},
"metadata": {}
},
"order": {
"channelOrderId": "5f6fb9fa-71ad-4758-8118-b9966d950105",
"channelOrderDisplayId": "5f6fb9fa",
"status": null
}
}
{
"id": "6643861d0c1914c93a846b78",
"created": "2024-05-14T15:41:17.518000+00:00",
"updated": "2024-05-14T15:41:18.449000+00:00",
"deleted": false,
"etag": "f225b232489659ed4dc0f17580f4f0200f4ca3ba",
"accountId": "65c35d109a19b819b7cf78d8",
"storeId": "65eee6a9984a1bc1b9637c59",
"channelLinkId": "65eee6a9984a1bc1b9637c59",
"status": "open",
"basket": {
"currency": "EUR",
"taxExclusive": false,
"items": [
{
"menuId": "62d7f77f64c95193cc29aa91",
"plu": "STK-01",
"name": "Delicious Steak Frites",
"quantity": 1,
"price": 1500,
"gross": 1500,
"taxes": [],
"net": 1500,
"subItems": [],
"discounts": [],
"discountTotal": 0
}
],
"payment": {
"tips": [
{
"amount": 100,
"type": "restaurant"
}
],
"discountsTotal": 0,
"taxTotal": 0,
"tipTotal": 100,
"total": 1600
},
"customer": {
"name": "John Doe",
"companyName": "ACME",
"phoneNumber": "+3211223344",
"email": "john.doe@acme.com",
"tin": "123456789"
},
"fulfillment": {
"type": "pickup"
},
"taxes": [],
"discounts": []
},
"payment": {
"id": "62d7f77f64c95193cc29aa91",
"status": "pending",
"action": {
"type": "redirect",
"url": "http://payment.acme.com/1234"
}
},
"order": null
}
Response examples (422)
{
"code": "payment_amount_mismatch",
"message": "Total of payments does not match basket payment total",
"context": {
"paymentsTotal": 856,
"basketTotal": 854
}
}