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_payment_wall', 'payu_sp_pbl', 'payu_sp_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 59fdd53d1a1a7bab1c23e3f953d02d20202c6117e85519634c6ab165bb406379ee432b8d2991723b30efc0ab158e367c303c3c8bcf928ddbc0b05c224392694b020de614e9e66395ed4093e7b9fc5fbad2131cbe1827b67ba47b8c5fbee57a6bb4225d81
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 631
{
    "cart": [
        {
            "product_id": 300,
            "options": [],
            "product_price_id": null,
            "shop_id": 115,
            "amount": 10,
            "persons": 0,
            "gram": 0,
            "comment": ""
        }
    ],
    "checkout": {
        "method": "takeout",
        "takeout": {
            "shops": {
                "shop_115": {
                    "id": 115,
                    "date": "2020-06-22",
                    "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 59fdd53d1a1a7bab1c23e3f953d02d20202c6117e85519634c6ab165bb406379ee432b8d2991723b30efc0ab158e367c303c3c8bcf928ddbc0b05c224392694b020de614e9e66395ed4093e7b9fc5fbad2131cbe1827b67ba47b8c5fbee57a6bb4225d81
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 631
{
    "cart": [
        {
            "product_id": 300,
            "options": [],
            "product_price_id": null,
            "shop_id": 115,
            "amount": 11,
            "persons": 0,
            "gram": 0,
            "comment": ""
        }
    ],
    "checkout": {
        "method": "takeout",
        "takeout": {
            "shops": {
                "shop_115": {
                    "id": 115,
                    "date": "2020-06-22",
                    "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: 2411

{
    "order_group": {
        "id": 45,
        "orders": [
            {
                "id": 45,
                "status": "APPROVED",
                "valid": true,
                "order_nr": 1,
                "prices": {
                    "price": {
                        "value": 22160,
                        "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": 22160,
                        "currency": "EUR"
                    }
                },
                "payment_method": "point_of_sale",
                "checkout": {
                    "method": "takeout",
                    "date": "2020-06-22",
                    "time": "13:00"
                },
                "created_at": 1592307615,
                "shop": {
                    "id": 115,
                    "name": "Cake-A-Licious",
                    "address": {
                        "street": "Desmedtstraat",
                        "nr": "66",
                        "zipcode": "4770",
                        "city": "Ronse",
                        "country": "BE",
                        "position": {
                            "latitude": 51.260197,
                            "longitude": 4.402771
                        }
                    },
                    "allow_comments": true,
                    "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"
    }
]
1.5.0 stable