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",
"etag": "2e94b59d6155094830af3362502fddc0cd51ef2f",
"order": {
"status": null,
"channelOrderId": "5f6fb9fa-71ad-4758-8118-b9966d950105",
"channelOrderDisplayId": "5f6fb9fa"
},
"basket": {
"id": "694138103662b46bddf06e6e",
"items": [
{
"id": "694138103662b46bddf06e6f",
"net": 1500,
"plu": "STK-01",
"name": "Delicious Steak Frites",
"note": "ITEM LEVEL NOTE",
"gross": 1500,
"price": 1500,
"taxes": [],
"menuId": "6882366cf04ece702e6661c8",
"quantity": 1,
"subItems": [
{
"plu": "COOK-01",
"name": "Rare",
"note": null,
"price": 0,
"quantity": 1,
"subItems": [],
"customizationPlu": "MOD-01"
},
{
"plu": "SI-01",
"name": "Fries",
"note": null,
"price": 0,
"quantity": 1,
"subItems": [],
"customizationPlu": "MOD-02"
}
],
"discounts": [],
"discountTotal": 0
}
],
"taxes": [],
"status": "open",
"channel": 10165,
"charges": {
"bagFee": {
"net": 0,
"tax": 0,
"gross": 0,
"value": 0,
"taxRate": 0
},
"netTotal": 0,
"taxTotal": 0,
"grossTotal": 0,
"deliveryFee": {
"net": 0,
"tax": 0,
"gross": 0,
"value": 0,
"taxRate": 0
},
"serviceCharge": {
"net": 0,
"tax": 0,
"type": "fixed",
"gross": 0,
"value": 0,
"taxRate": 0
}
},
"payment": {
"tips": [],
"total": 1500,
"subTotal": 1500,
"taxTotal": 0,
"tipTotal": 0,
"chargesTotal": 0,
"discountsTotal": 0
},
"category": {
"type": "restaurant"
},
"currency": "AED",
"customer": {
"tin": null,
"name": "John Doe",
"email": "john.doe@acme.com",
"externalId": "custom_channel_id_12345",
"companyName": "ACME",
"phoneNumber": "+32474081356",
"loyaltyProviderCustomerId": null
},
"discounts": [],
"fulfillment": {
"spot": "TABLE-1",
"type": "eatIn"
},
"taxExclusive": false
},
"status": "open",
"created": "2025-12-16T10:44:35.107000",
"deleted": false,
"payment": {
"id": "694138133662b46bddf06e71",
"action": {
"paid": true,
"type": "offline"
},
"status": "authorized",
"gateway": 1,
"metadata": {}
},
"storeId": "6911e9be1531637e9cf80a5f",
"updated": "2025-12-16T10:44:51.016000+00:00",
"accountId": "668cd58b6da5e4cec26f1f35",
"channelLinkId": "6911e9be1531637e9cf80a5f",
"failureReason": null
}
{
"id": "6643861d0c1914c93a846b78",
"etag": "f225b232489659ed4dc0f17580f4f0200f4ca3ba",
"order": null,
"basket": {
"items": [
{
"net": 1500,
"plu": "STK-01",
"name": "Delicious Steak Frites",
"gross": 1500,
"price": 1500,
"taxes": [],
"menuId": "62d7f77f64c95193cc29aa91",
"quantity": 1,
"subItems": [],
"discounts": [],
"discountTotal": 0
}
],
"taxes": [],
"payment": {
"tips": [
{
"type": "restaurant",
"amount": 100
}
],
"total": 1600,
"taxTotal": 0,
"tipTotal": 100,
"discountsTotal": 0
},
"currency": "EUR",
"customer": {
"tin": "123456789",
"name": "John Doe",
"email": "john.doe@acme.com",
"companyName": "ACME",
"phoneNumber": "+3211223344"
},
"discounts": [],
"fulfillment": {
"type": "pickup"
},
"taxExclusive": false
},
"status": "open",
"created": "2024-05-14T15:41:17.518000+00:00",
"deleted": false,
"payment": {
"id": "62d7f77f64c95193cc29aa91",
"action": {
"url": "http://payment.acme.com/1234",
"type": "redirect"
},
"status": "pending"
},
"storeId": "65eee6a9984a1bc1b9637c59",
"updated": "2024-05-14T15:41:18.449000+00:00",
"accountId": "65c35d109a19b819b7cf78d8",
"channelLinkId": "65eee6a9984a1bc1b9637c59"
}
Response examples (422)
{
"code": "payment_amount_mismatch",
"context": {
"basketTotal": 854,
"paymentsTotal": 856
},
"message": "Total of payments does not match basket payment total"
}