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: 0.2.1
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 4907
{
"cart": [
{
"amount": 18,
"persons": 12,
"gram": 12,
"comment": "...",
"product_id": 16,
"product_price_id": 13,
"shop_id": 18,
"option_ids": [
15,
12,
18
],
"uploads": [
{
"upload": {
"id": 12,
"url": "https://example.com"
},
"optionset_id": 19
},
{
"upload": {
"id": 11,
"url": "https://example.com"
},
"optionset_id": 19
},
{
"upload": {
"id": 13,
"url": "https://example.com"
},
"optionset_id": 15
}
],
"code": "..."
},
{
"amount": 16,
"persons": 15,
"gram": 12,
"comment": "...",
"product_id": 18,
"product_price_id": 15,
"shop_id": 16,
"option_ids": [
14,
13,
18
],
"uploads": [
{
"upload": {
"id": 13,
"url": "https://example.com"
},
"optionset_id": 18
},
{
"upload": {
"id": 13,
"url": "https://example.com"
},
"optionset_id": 15
},
{
"upload": {
"id": 19,
"url": "https://example.com"
},
"optionset_id": 13
}
],
"code": "..."
},
{
"amount": 19,
"persons": 14,
"gram": 10,
"comment": "...",
"product_id": 19,
"product_price_id": 16,
"shop_id": 13,
"option_ids": [
12,
17,
14
],
"uploads": [
{
"upload": {
"id": 19,
"url": "https://example.com"
},
"optionset_id": 10
},
{
"upload": {
"id": 11,
"url": "https://example.com"
},
"optionset_id": 19
},
{
"upload": {
"id": 18,
"url": "https://example.com"
},
"optionset_id": 14
}
],
"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": 17,
"date": "2019-01-31",
"time": "12:00",
"notification_method": "email",
"telephone": "+32 475 00 00 00"
},
"isop": {
"origin": "in-store",
"customer_id": 18,
"employee_id": 11
},
"warranty": {
"bank": "ING. Bank"
},
"invoice": {
"company": {
"name": "...",
"vat": "BE0123456789",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE"
}
}
},
"config": {
"askInvoice": true,
"askIsop": false
},
"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: 20036
{
"cart": [
{
"amount": 18,
"persons": 14,
"gram": 16,
"comment": "...",
"product": {
"id": 19,
"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": 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
},
{
"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": 13
},
"product_price": {
"id": 15,
"name": "...",
"price": 12
},
"calculated_prices": {
"unit_price": 18,
"price": 18
},
"discount_prices": {
"unit_price": 18,
"price": 11
},
"shop": {
"id": 14,
"name": "Dr. Maurice West I",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
}
},
"options": [
{
"id": 11,
"name": "...",
"price_change": 10,
"optionset": {
"id": 11,
"name": "...",
"allow_attachment": true
}
},
{
"id": 18,
"name": "...",
"price_change": 17,
"optionset": {
"id": 18,
"name": "...",
"allow_attachment": true
}
},
{
"id": 12,
"name": "...",
"price_change": 15,
"optionset": {
"id": 14,
"name": "...",
"allow_attachment": true
}
}
],
"uploads": [
{
"upload": {
"id": 15,
"url": "https://example.com"
},
"optionset_id": 12
},
{
"upload": {
"id": 17,
"url": "https://example.com"
},
"optionset_id": 15
},
{
"upload": {
"id": 12,
"url": "https://example.com"
},
"optionset_id": 17
}
],
"code": "..."
},
{
"amount": 18,
"persons": 17,
"gram": 19,
"comment": "...",
"product": {
"id": 11,
"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": 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
},
{
"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": true,
"price": 13
},
"product_price": {
"id": 11,
"name": "...",
"price": 10
},
"calculated_prices": {
"unit_price": 16,
"price": 19
},
"discount_prices": {
"unit_price": 14,
"price": 14
},
"shop": {
"id": 12,
"name": "Dr. Cale Hirthe I",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
}
},
"options": [
{
"id": 17,
"name": "...",
"price_change": 17,
"optionset": {
"id": 11,
"name": "...",
"allow_attachment": true
}
},
{
"id": 16,
"name": "...",
"price_change": 14,
"optionset": {
"id": 15,
"name": "...",
"allow_attachment": false
}
},
{
"id": 11,
"name": "...",
"price_change": 10,
"optionset": {
"id": 13,
"name": "...",
"allow_attachment": false
}
}
],
"uploads": [
{
"upload": {
"id": 13,
"url": "https://example.com"
},
"optionset_id": 11
},
{
"upload": {
"id": 10,
"url": "https://example.com"
},
"optionset_id": 12
},
{
"upload": {
"id": 13,
"url": "https://example.com"
},
"optionset_id": 11
}
],
"code": "..."
},
{
"amount": 18,
"persons": 17,
"gram": 19,
"comment": "...",
"product": {
"id": 11,
"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": 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
},
{
"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": 18
},
"product_price": {
"id": 18,
"name": "...",
"price": 14
},
"calculated_prices": {
"unit_price": 12,
"price": 14
},
"discount_prices": {
"unit_price": 18,
"price": 19
},
"shop": {
"id": 14,
"name": "Prof. Arnaldo Lockman IV",
"address": {
"street": "Sint-Denijslaan",
"nr": "96",
"zipcode": "9000",
"city": "Gent",
"country": "BE",
"position": {
"latitude": 1.54361,
"longitude": 0.45645
}
}
},
"options": [
{
"id": 10,
"name": "...",
"price_change": 13,
"optionset": {
"id": 18,
"name": "...",
"allow_attachment": false
}
},
{
"id": 10,
"name": "...",
"price_change": 10,
"optionset": {
"id": 16,
"name": "...",
"allow_attachment": false
}
},
{
"id": 18,
"name": "...",
"price_change": 13,
"optionset": {
"id": 16,
"name": "...",
"allow_attachment": false
}
}
],
"uploads": [
{
"upload": {
"id": 19,
"url": "https://example.com"
},
"optionset_id": 16
},
{
"upload": {
"id": 18,
"url": "https://example.com"
},
"optionset_id": 17
},
{
"upload": {
"id": 10,
"url": "https://example.com"
},
"optionset_id": 16
}
],
"code": "..."
}
],
"cart_config": {
"target_price": true,
"prices": {
"price": 16,
"discount": 17,
"warranty": 18,
"delivery_cost": 19,
"invoice_cost": 11,
"sms_cost": 14,
"transaction_cost": 12,
"price_to_pay": 10,
"price_with_discount": 18
},
"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": true
},
"delivery": {
"allowed": false,
"use_intervals": false,
"messages": [
"...",
"...",
"..."
]
},
"latch": {
"allowed": false,
"latches": [
15,
17,
18
]
},
"checkout_method_messages": [
"...",
"...",
"..."
],
"warranty": false,
"discounts": [
{
"name": "...",
"description": "...",
"percentage": 9.67,
"fixed": 18,
"type": "first-order",
"code": "..."
},
{
"name": "...",
"description": "...",
"percentage": 9.67,
"fixed": 16,
"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": "..."
}
]
}