POST /checkout
You can use authentication for this request, but it is not required. Always provide the access_token when you have one. It may affect the response.
Header | Value |
---|---|
Authorization | Optional. Set the value to Bearer + + access_token |
Pass the following properties via application/json or form encoding in the body of the request.
A dictionary with fields
Field | Type | Description |
---|---|---|
cart | [CartItem.cart] | Array of CartItem.cart |
checkout | Checkout.Checkout | Optional. |
payment_method | String | Optional. String enumarion of 'point_of_sale', 'paid_in_shop', 'bank_transfer', 'ideal', 'bancontact', 'sofort', 'giropay', 'creditcard', 'carte_bleue', 'paypal', 'eps_uberweisung', 'apple_pay', 'google_pay', 'payconiq', 'monizze', 'edenred', 'webpay', 'satispay', 'stripe_card_visa_mc', 'stripe_card_amex', 'stripe_apple_pay', 'stripe_google_pay', 'payu_romania_visa', 'payu_romania_mc', 'payu_romania_visa_electron', 'payu_romania_maestro', 'payu_brazil_amex', 'payu_brazil_boleto_bancario', 'payu_brazil_diners', 'payu_brazil_elo', 'payu_brazil_hipercard', 'payu_brazil_mc', 'payu_brazil_visa', 'payu_sp_maestro', 'payu_sp_mc', 'payu_sp_pbl', 'payu_sp_visa', 'payu_sp_blik', 'payu_iyzico_amex', 'payu_iyzico_mc', 'payu_iyzico_troy', 'payu_iyzico_visa', 'pesopay_gcash', 'pesopay_visa', 'pesopay_mc', 'redsys_bizum', 'sibs_id' |
POST /checkout HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.0.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 4907
{
"cart": [
{
"amount": 12,
"persons": 16,
"gram": 14,
"comment": "...",
"product_id": 17,
"product_price_id": 14,
"shop_id": 12,
"option_ids": [
12,
10,
10
],
"uploads": [
{
"upload": {
"id": 19,
"url": "https://example.com"
},
"optionset_id": 12
},
{
"upload": {
"id": 17,
"url": "https://example.com"
},
"optionset_id": 18
},
{
"upload": {
"id": 11,
"url": "https://example.com"
},
"optionset_id": 12
}
],
"code": "..."
},
{
"amount": 10,
"persons": 16,
"gram": 11,
"comment": "...",
"product_id": 10,
"product_price_id": 12,
"shop_id": 12,
"option_ids": [
19,
13,
14
],
"uploads": [
{
"upload": {
"id": 17,
"url": "https://example.com"
},
"optionset_id": 13
},
{
"upload": {
"id": 12,
"url": "https://example.com"
},
"optionset_id": 13
},
{
"upload": {
"id": 15,
"url": "https://example.com"
},
"optionset_id": 15
}
],
"code": "..."
},
{
"amount": 11,
"persons": 16,
"gram": 19,
"comment": "...",
"product_id": 13,
"product_price_id": 14,
"shop_id": 10,
"option_ids": [
19,
10,
19
],
"uploads": [
{
"upload": {
"id": 13,
"url": "https://example.com"
},
"optionset_id": 17
},
{
"upload": {
"id": 17,
"url": "https://example.com"
},
"optionset_id": 12
},
{
"upload": {
"id": 19,
"url": "https://example.com"
},
"optionset_id": 13
}
],
"code": "..."
}
],
"checkout": {
"method": "delivery",
"delivery": {
"date": "2019-01-31",
"time": "12:00",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE"
},
"notes": "...",
"end_time": "12:00"
},
"takeout": {
"shops": {
"...": {
"id": 17,
"date": "2019-01-31",
"time": "12:00"
}
}
},
"latch": {
"latch_id": 10,
"telephone": "+32 475 00 00 00",
"date": "2019-01-31",
"time": "12:00",
"notification_method": "email"
},
"isop": {
"origin": "in-store",
"customer_id": 17,
"employee_id": 13
},
"warranty": {
"bank": "ING. Bank"
},
"invoice": {
"company": {
"name": "...",
"vat": "BE0123456789",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE"
}
}
},
"config": {
"askInvoice": false,
"askIsop": true
},
"coupons": [
{
"code": "..."
},
{
"code": "..."
},
{
"code": "..."
}
]
},
"payment_method": "point_of_sale"
}
A dictionary with fields
Field | Type | Description |
---|---|---|
cart | [CartItem.cart] | When a cart is returned, you are required to overwrite the cart in your app with the changed cart in the response. You should display a message to the user that you did change the cart. The errors field will contain human readable errors with the changes that have been made. If no errors are set, you should default to a generic message. |
cart_config | CartConfig | Optional. When available, this will return all essential information about the cart. When the cart is also set in the response, the cart_config contains information about the cart in the response, not in the request. |
errors | [ValidationError] | Optional. Allows to return error messages while still providing a corrected cart in the cart field. Can also contain errors about the checkout. Warning: It is still possible to return the default error structure (single error, or array of errors in response, see documentation) if errors occur before a corrected cart could get generated. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 21664
{
"cart": [
{
"amount": 18,
"persons": 19,
"gram": 15,
"comment": "...",
"product": {
"id": 13,
"name": "...",
"images": [
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": true
},
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": true
},
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": false
}
],
"price_type": "PER_UNIT",
"target_price": false,
"price": 18
},
"product_price": {
"id": 17,
"name": "...",
"price": 10
},
"calculated_prices": {
"unit_price": 12,
"price": 18
},
"discount_prices": {
"unit_price": 12,
"price": 15
},
"shop": {
"id": 15,
"name": "Mrs. Sister Kerluke",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
},
"currency": "EUR"
},
"options": [
{
"id": 19,
"name": "...",
"price_change": 14,
"optionset": {
"id": 17,
"name": "...",
"allow_attachment": false
}
},
{
"id": 18,
"name": "...",
"price_change": 16,
"optionset": {
"id": 14,
"name": "...",
"allow_attachment": true
}
},
{
"id": 12,
"name": "...",
"price_change": 15,
"optionset": {
"id": 16,
"name": "...",
"allow_attachment": true
}
}
],
"uploads": [
{
"upload": {
"id": 10,
"url": "https://example.com"
},
"optionset_id": 13
},
{
"upload": {
"id": 11,
"url": "https://example.com"
},
"optionset_id": 19
},
{
"upload": {
"id": 19,
"url": "https://example.com"
},
"optionset_id": 17
}
],
"code": "..."
},
{
"amount": 19,
"persons": 11,
"gram": 10,
"comment": "...",
"product": {
"id": 13,
"name": "...",
"images": [
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": true
},
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": false
},
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": true
}
],
"price_type": "PER_UNIT",
"target_price": false,
"price": 16
},
"product_price": {
"id": 13,
"name": "...",
"price": 18
},
"calculated_prices": {
"unit_price": 13,
"price": 12
},
"discount_prices": {
"unit_price": 19,
"price": 17
},
"shop": {
"id": 14,
"name": "Modesto Mann",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
},
"currency": "EUR"
},
"options": [
{
"id": 11,
"name": "...",
"price_change": 13,
"optionset": {
"id": 16,
"name": "...",
"allow_attachment": false
}
},
{
"id": 18,
"name": "...",
"price_change": 14,
"optionset": {
"id": 16,
"name": "...",
"allow_attachment": true
}
},
{
"id": 18,
"name": "...",
"price_change": 10,
"optionset": {
"id": 10,
"name": "...",
"allow_attachment": false
}
}
],
"uploads": [
{
"upload": {
"id": 16,
"url": "https://example.com"
},
"optionset_id": 16
},
{
"upload": {
"id": 19,
"url": "https://example.com"
},
"optionset_id": 11
},
{
"upload": {
"id": 11,
"url": "https://example.com"
},
"optionset_id": 15
}
],
"code": "..."
},
{
"amount": 13,
"persons": 10,
"gram": 10,
"comment": "...",
"product": {
"id": 18,
"name": "...",
"images": [
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": true
},
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": false
},
{
"resolutions": [
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
},
{
"src": "https://example.com",
"width": 600,
"height": 350
}
],
"white_background": false
}
],
"price_type": "PER_UNIT",
"target_price": true,
"price": 16
},
"product_price": {
"id": 15,
"name": "...",
"price": 10
},
"calculated_prices": {
"unit_price": 17,
"price": 14
},
"discount_prices": {
"unit_price": 15,
"price": 18
},
"shop": {
"id": 13,
"name": "Collin Durgan III",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
},
"currency": "EUR"
},
"options": [
{
"id": 16,
"name": "...",
"price_change": 11,
"optionset": {
"id": 11,
"name": "...",
"allow_attachment": false
}
},
{
"id": 19,
"name": "...",
"price_change": 13,
"optionset": {
"id": 10,
"name": "...",
"allow_attachment": true
}
},
{
"id": 16,
"name": "...",
"price_change": 11,
"optionset": {
"id": 16,
"name": "...",
"allow_attachment": false
}
}
],
"uploads": [
{
"upload": {
"id": 10,
"url": "https://example.com"
},
"optionset_id": 12
},
{
"upload": {
"id": 16,
"url": "https://example.com"
},
"optionset_id": 11
},
{
"upload": {
"id": 15,
"url": "https://example.com"
},
"optionset_id": 13
}
],
"code": "..."
}
],
"cart_config": {
"target_price": true,
"prices": {
"price": 16,
"discount": 16,
"warranty": 18,
"delivery_cost": 16,
"invoice_cost": 19,
"sms_cost": 13,
"transaction_cost": 13,
"price_to_pay": 12,
"price_with_discount": 15
},
"payment": {
"methods": [
"point_of_sale",
"paid_in_shop",
"bank_transfer",
"ideal",
"bancontact",
"sofort",
"giropay",
"creditcard",
"carte_bleue",
"paypal",
"eps_uberweisung",
"apple_pay",
"google_pay",
"payconiq",
"monizze",
"edenred",
"webpay",
"satispay",
"stripe_card_visa_mc",
"stripe_card_amex",
"stripe_apple_pay",
"stripe_google_pay",
"payu_romania_visa",
"payu_romania_mc",
"payu_romania_visa_electron",
"payu_romania_maestro",
"payu_brazil_amex",
"payu_brazil_boleto_bancario",
"payu_brazil_diners",
"payu_brazil_elo",
"payu_brazil_hipercard",
"payu_brazil_mc",
"payu_brazil_visa",
"payu_sp_maestro",
"payu_sp_mc",
"payu_sp_pbl",
"payu_sp_visa",
"payu_sp_blik",
"payu_iyzico_amex",
"payu_iyzico_mc",
"payu_iyzico_troy",
"payu_iyzico_visa",
"pesopay_gcash",
"pesopay_visa",
"pesopay_mc",
"redsys_bizum",
"sibs_id"
],
"messages": [
"...",
"...",
"..."
]
},
"takeout": {
"allowed": false
},
"delivery": {
"allowed": true,
"use_intervals": false,
"messages": [
"...",
"...",
"..."
]
},
"latch": {
"allowed": true,
"latches": [
{
"id": 10,
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
},
"name": "..."
},
{
"id": 11,
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
},
"name": "..."
},
{
"id": 15,
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
},
"name": "..."
}
]
},
"checkout_method_messages": [
"...",
"...",
"..."
],
"warranty": true,
"discounts": [
{
"name": "...",
"description": "...",
"percentage": 9.67,
"fixed": 13,
"type": "first-order",
"code": "..."
},
{
"name": "...",
"description": "...",
"percentage": 9.67,
"fixed": 13,
"type": "first-order",
"code": "..."
},
{
"name": "...",
"description": "...",
"percentage": 9.67,
"fixed": 13,
"type": "first-order",
"code": "..."
}
],
"allow_combined_cart": false,
"invoice": {
"messages": [
"...",
"...",
"..."
]
}
},
"errors": [
{
"code": "...",
"message": "...",
"field": "..."
},
{
"code": "...",
"message": "...",
"field": "..."
},
{
"code": "...",
"message": "...",
"field": "..."
}
]
}