Place an order

POST /checkout/order

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

Body

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
payment_method String String enumarion of 'point_of_sale', 'paid_in_shop', 'bank_transfer', 'ideal', 'bancontact', 'sofort', 'giropay', 'creditcard', 'cartes_bancaires', 'paypal', 'eps_uberweisung', 'payconiq', 'monizze', 'edenred', 'webpay', 'credomatic', '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'
return_url URL An URL field starting with http:// or https://

Example request 1 Simple cart item

POST /checkout/order HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 1fb0e6bb01ed4720c53f5c0be3ca3306d3a0abf3fc8efdf732a68a73fa8feebe70d5577fba29a22616dad52294b0e30dc32dc870a69d396dd0d6f94b7184709ab2cc3ceae0f1e32f4704c576a02d3dcb5f167bed43a593d07bd024cf40aad1d533511bf1
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 635
{
    "cart": [
        {
            "product_id": 6556,
            "options": [],
            "product_price_id": null,
            "shop_id": 2824,
            "amount": 10,
            "persons": 0,
            "gram": 0,
            "comment": ""
        }
    ],
    "checkout": {
        "method": "takeout",
        "takeout": {
            "shops": {
                "shop_2824": {
                    "id": 2824,
                    "date": "2021-04-26",
                    "time": "13:00"
                }
            }
        }
    },
    "payment_method": "point_of_sale",
    "return_url": "https://bakeronline.com"
}

Example request 2 Invalid cart

POST /checkout/order HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 1fb0e6bb01ed4720c53f5c0be3ca3306d3a0abf3fc8efdf732a68a73fa8feebe70d5577fba29a22616dad52294b0e30dc32dc870a69d396dd0d6f94b7184709ab2cc3ceae0f1e32f4704c576a02d3dcb5f167bed43a593d07bd024cf40aad1d533511bf1
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 635
{
    "cart": [
        {
            "product_id": 6556,
            "options": [],
            "product_price_id": null,
            "shop_id": 2824,
            "amount": 11,
            "persons": 0,
            "gram": 0,
            "comment": ""
        }
    ],
    "checkout": {
        "method": "takeout",
        "takeout": {
            "shops": {
                "shop_2824": {
                    "id": 2824,
                    "date": "2021-04-26",
                    "time": "13:00"
                }
            }
        }
    },
    "payment_method": "point_of_sale",
    "return_url": "https://bakeronline.com"
}

Response

A dictionary with fields

Field Type Description
order_group OrderGroup
payment_url URL? Nullable. An URL field starting with http:// or https://

Example response 1 Simple cart item

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 2419

{
    "order_group": {
        "id": 1154,
        "orders": [
            {
                "id": 1154,
                "status": "APPROVED",
                "valid": true,
                "order_nr": 1,
                "prices": {
                    "price": {
                        "value": 35950,
                        "currency": "EUR"
                    },
                    "discount": {
                        "value": 0,
                        "currency": "EUR"
                    },
                    "warranty": {
                        "value": 0,
                        "currency": "EUR"
                    },
                    "delivery_cost": {
                        "value": 0,
                        "currency": "EUR"
                    },
                    "invoice_cost": {
                        "value": 0,
                        "currency": "EUR"
                    },
                    "sms_cost": {
                        "value": 0,
                        "currency": "EUR"
                    },
                    "transaction_cost": {
                        "value": 0,
                        "currency": "EUR"
                    },
                    "price_to_pay": {
                        "value": 35950,
                        "currency": "EUR"
                    }
                },
                "payment_method": "point_of_sale",
                "checkout": {
                    "method": "takeout",
                    "date": "2021-04-26",
                    "time": "13:00"
                },
                "created_at": 1618995622,
                "shop": {
                    "id": 2824,
                    "name": "Top of the Muffin",
                    "address": {
                        "street": "Jansenpad",
                        "nr": "91",
                        "zipcode": "1470",
                        "city": "Tongeren",
                        "country": "BE",
                        "position": {
                            "latitude": 51.260197,
                            "longitude": 4.402771
                        }
                    },
                    "allow_comments": false,
                    "currency": "EUR"
                },
                "payment_status": null,
                "joyn": null,
                "currency": "EUR"
            }
        ]
    },
    "payment_url": null
}

Example response 2 Invalid cart

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 102

[
    {
        "code": "corrected_cart",
        "message": "2069",
        "field": "cart.0"
    }
]
Version update available Please adjust your integration to the latest stable version (1.5.2)
1.5.0 stable