Dinlr Online Order API

1. Authorization

The Dinlr Online Order API allows authorization using the OAuth 2.0 standard. Currently, we only support the Authorization Code Grant.

1.1 OAuth 2.0

Before starting, create a Dinlr application. To do this follow the steps below:

Step 1. Register as a Partner

If you have not done this yet, register a partner account here: https://partners.dinlr.com

Step 2. Create a Dinlr Application

Once you sign in you can click on "Apps" located at the side menu, which will show you a list of your Applications. Now you are ready to create your first app.

As a result, this process will give you the client_id and the client_secret which are used to identify your applications and are therefore, required to complete the authorization process.

redirect_uri is the URL where you want to redirect the users after they authorize the client.

1.2 Connecting your application to a Dinlr Account

Implement the following steps to connect your application to a Dinlr account.

Step 1. Requesting Authorization Code

The restaurant needs to authorize your application to access their data. Send them the following URL so that they can authorize your application


https://backoffice.dinlr.com/oauth/authorize?client_id={client_id}&redirect_uri={redirect_uri}&state={state}

The redirect_uri must be identical to one of the Application Redirect URI.

Once the restaurant has authorized the application, Dinlr will send an authorization code and the restaurant id to the Redirect URI you set up with your application.


Successful Authorization Response
{redirect_uri}?code={code}&restaurant_id={restaurant_id}&state={state}

Declined Access Response
{redirect_uri}?error=access_denied

Before you proceed, make sure your application performs the following security checks. If any of the checks fails, your application must reject the request with an error, and must not proceed further.

  • Ensure the provided state is the same one that your application provided to Dinlr during Step 1. Requesting Authorization Code.

If all security check pass, the authorization code can be exchanged once for an access and a refresh token.

Step 2. Requesting an Access and a Refresh Token

Once you have the authorization code, your application can now request an access token and a refresh token.

The following data should be sent as "application/x-www-form-urlencoded" encoded body of a POST request.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/oauth/token

Parameters
  • code
  • client_id
  • client_secret
  • grant_type - this is always authorization_code

Response
{
    "access_token": "{access_token}",
    "token_type": "bearer",
    "expires_in": 1209600,
    "refresh_token": "{refresh_token}"
}

Step 3. Using Access Token to access Dinlr Online Order API

Your application can use the received access token to interact with the Dinlr API on behalf of the restaurant by providing the access token in an Authorization header.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/get-settings

Header
Authorization: Bearer {access_token}

Step 4. Refreshing the Access Token

When the access token expires, your application can request a new access token using the refresh token received in Step 2. Requesting an Access and a Refresh Token.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/oauth/token

Parameters
  • refresh_token
  • client_id
  • client_secret
  • grant_type - when refreshing tokens it should be refresh_token

Response
{
    "access_token": "{access_token}",
    "token_type": "bearer",
    "expires_in": 1209600,
    "refresh_token": "{refresh_token}"
}

2. Restaurant Settings

2.1 Retrieve all Locations

Returns a list of all locations of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/locations

URL Parameters
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show locations last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{location_id}",
            "name": "Chinatown",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{location_id}",
            "name": "New York",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{location_id}",
            "name": "Pop-up Event",
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

2.2 Retrieve all Dining Options

Returns a list of all dining options of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/dining-options?location_id={location_id}

URL Parameters
  • location_id
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show dining options last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{dining_option_id}",
            "name": "Dine-in",
            "sort": 0,
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{dining_option_id}",
            "name": "Takeaway",
            "sort": 1,
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{dining_option_id}",
            "name": "Delivery",
            "sort": 2,
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

2.3 Retrieve all Payment Methods

Returns a list of all payment methods of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/payments?location_id={location_id}

URL Parameters
  • location_id
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show payment methods last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{payment_id}",
            "name": "Cash",
            "sort": 0,
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{payment_id}",
            "name": "VISA",
            "sort": 1,
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{payment_id}",
            "name": "Mastercard",
            "sort": 2,
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

2.4 Retrieve all Charges

Returns a list of all charges of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/charges?location_id={location_id}

URL Parameters
  • location_id
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show charges last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{charge_id}",
            "name": "Service Charge",
            "updated_at": "2018-03-08T13:00:00+08:00",
            "dining_options": [ - list of dining options that apply this charge
                {
                    "id": "{dining_option_id}"
                },
                {
                    "id": "{dining_option_id}"
                }
            ]
        },
        {
            "id": "{charge_id}",
            "name": "Takeaway Charge",
            "updated_at": "2018-03-08T13:00:00+08:00",
            "dining_options": [ - list of dining options that apply this charge
                {
                    "id": "{dining_option_id}"
                }
            ]
        },
        {
            "id": "{charge_id}",
            "name": "Delivery Fee",
            "updated_at": "2018-03-08T13:00:00+08:00",
            "dining_options": [ - list of dining options that apply this charge
                {
                    "id": "{dining_option_id}"
                },
                {
                    "id": "{dining_option_id}"
                },
                {
                    "id": "{dining_option_id}"
                }
            ]
        }
    ]
}

2.5 Retrieve Restaurant Settings (Depreciated)

This endpoint has been depreciated, these data will be accessible from their new endpoints.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/get-settings

Header
Authorization: Bearer {access_token}

Response
{
    "data": {
        "locations": [ (Depreciated) (Location data moved to 2.1 Retrieve all Locations)
            {
                "id": "{location_id}",
                "name": "Chinatown"
            },
            {
                "id": "{location_id}",
                "name": "New York"
            }
        ],
        "dining_options": [ (Depreciated) (Dining option data moved to 2.2 Retrieve all Dining Options)
            {
                "id": "{dining_option_id}",
                "name": "Dine-in",
                "sort": 0
            },
            {
                "id": "{dining_option_id}",
                "name": "Takeaway",
                "sort": 1
            },
            {
                "id": "{dining_option_id}",
                "name": "Delivery",
                "sort": 2
            }
        ],
        "payments": [ (Depreciated) (Payment data moved to 2.3 Retrieve all Payment Methods)
            {
                "id": "{payment_id}",
                "name": "Cash",
                "sort": 0
            },
            {
                "id": "{payment_id}",
                "name": "Visa",
                "sort": 1
            },
            {
                "id": "{payment_id}",
                "name": "Mastercard",
                "sort": 2
            }
        ],
        "categories": [ (Depreciated) (Category data moved to 4.3 Retrieve all Categories)
            {
                "id": "{category_id}",
                "name": "Food",
                "sub_categories": [
                    {
                        "id": "{category_id}",
                        "name": "Burger"
                    },
                    {
                        "id": "{category_id}",
                        "name": "Sides"
                    }
                ]
            },
            {
                "id": "{category_id}",
                "name": "Drinks",
                "sub_categories": [
                ]
            }
        ],
        "modifiers": [ (Depreciated) (Modifier data moved to 4.2 Retrieve all Modifiers)
            {
                "id": "{modifier_id}",
                "name": "Ice Level",
                "min_selection": 0, - null represents optional
                "max_selection": 1, - null represents unlimited
                "sort": 0,
                "modifier_options": [
                    {
                        "id": "{modifier_option_id}",
                        "name": "No Ice",
                        "price": 1,
                        "max_qty": 1,
                        "default_selected": false,
                        "show_in_menu": true,
                        "sort": 0
                    },
                    {
                        "id": "{modifier_option_id}",
                        "name": "Less Ice",
                        "price": 0.5,
                        "max_qty": 1,
                        "default_selected": false,
                        "show_in_menu": true,
                        "sort": 1
                    },
                    {
                        "id": "{modifier_option_id}",
                        "name": "More Ice",
                        "price": 0,
                        "max_qty": 1,
                        "default_selected": false,
                        "show_in_menu": true,
                        "sort": 2
                    }
                ]
            },
            {
                "id": "{modifier_id}",
                "name": "Steak Doneness",
                "min_selection": 1, - null represents optional
                "max_selection": 1, - null represents unlimited
                "sort": 1,
                "modifier_options": [
                    {
                        "id": "{modifier_option_id}",
                        "name": "Medium Rare",
                        "price": 0,
                        "max_qty": 1,
                        "default_selected": true,
                        "show_in_menu": true,
                        "sort": 0
                    },
                    {
                        "id": "{modifier_option_id}",
                        "name": "Medium",
                        "price": 0,
                        "max_qty": 1,
                        "default_selected": false,
                        "show_in_menu": true,
                        "sort": 1
                    },
                    {
                        "id": "{modifier_option_id}",
                        "name": "Well Done",
                        "price": 0,
                        "max_qty": 1,
                        "default_selected": false,
                        "show_in_menu": true,
                        "sort": 2
                    }
                ]
            }
        ],
        "charges": [ (Depreciated) (Charge data moved to 2.4 Retrieve all Charges)
            {
                "id": "{charge_id}",
                "name": "Service Charge",
                "dining_options": [ - list of dining options that apply this charge
                    "{dining_option_id}",
                    "{dining_option_id}"
                ]
            },
            {
                "id": "{charge_id}",
                "name": "Takeaway Charge",
                "dining_options": [ - list of dining options that apply this charge
                    "{dining_option_id}"
                ]
            },
            {
                "id": "{charge_id}",
                "name": "Delivery Fee",
                "dining_options": [ - list of dining options that apply this charge
                    "{dining_option_id}"
                ]
            }
        ],
        "customer_groups": [ (Depreciated) (Customer group data moved to 6.5 Retrieve all Customer Groups)
            {
                "id": "{customer_group_id}",
                "name": "Bronze Member"
            },
            {
                "id": "{customer_group_id}",
                "name": "Gold Member"
            },
            {
                "id": "{customer_group_id}",
                "name": "VVIP"
            }
        ]
    }
}

3. Floorplans

3.1 Retrieve all Floorplans

Returns a list of all floorplans of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/floorplans?location_id={location_id}

URL Parameters
  • location_id
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show floorplans last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{floorplan_id}",
            "name": "Main Dining Hall",
            "sort": 0,
            "updated_at": "2018-03-08T13:00:00+08:00",
            "objects": [
                {
                    "id": "{object_id}",
                    "name": "Table 1",
                    "pax": 4
                },
                {
                    "id": "{object_id}",
                    "name": "Table 2",
                    "pax": 4
                },
                {
                    "id": "{object_id}",
                    "name": "Bar Seat 1",
                    "pax": 1
                }
            ]
        },
        {
            "id": "{floorplan_id}",
            "name": "Balcony",
            "sort": 1,
            "updated_at": "2018-03-08T13:00:00+08:00",
            "objects": [
                {
                    "id": "{object_id}",
                    "name": "B10",
                    "pax": 2
                },
                {
                    "id": "{object_id}",
                    "name": "B11",
                    "pax": 2
                },
                {
                    "id": "{object_id}",
                    "name": "B12",
                    "pax": 2
                }
            ]
        }
    ]
}

4. Items & Discounts

4.1 Retrieve all Items

Returns a list of all items of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/items?location_id={location_id}

URL Parameters
  • location_id
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show items last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{item_id}",
            "item_no": "A1",
            "name": "Chargrilled Chicken Burger",
            "description": "Grilled chicken with BBQ sauce", - optional, max 100 characters
            "image": "https://cdn.dinlr.com/......jpg", - optional
            "category": "{category_id}",
            "updated_at": "2018-03-08T13:00:00+08:00",
            "variants": [
                {
                    "id": "{variant_id}",
                    "name": "Regular",
                    "sku": "CKREG",
                    "price": 9.5,
                    "show_in_menu": true,
                    "sort": 0
                },
                {
                    "id": "{variant_id}",
                    "name": "Large",
                    "sku": "CKLAR",
                    "price": 12.5,
                    "show_in_menu": true,
                    "sort": 1
                },
                {
                    "id": "{variant_id}",
                    "name": "Open Price",
                    "sku": null,
                    "show_in_menu": false,
                    "sort": 2
                }
            ],
            "modifiers": [
                {
                    "id": "{modifier_id}"
                },
                {
                    "id": "{modifier_id}"
                }
            ]
        },
        {
            "id": "{item_id}",
            "item_no": null,
            "name": "Cheesecake",
            "description": null,
            "image": null,
            "category": "{category_id}",
            "updated_at": "2018-03-08T13:00:00+08:00",
            "variants": [
                {
                    "id": "{variant_id}",
                    "name": "Blueberry",
                    "sku": "CCBLUE",
                    "price": 3.5,
                    "show_in_menu": true,
                    "sort": 0
                },
                {
                    "id": "{variant_id}",
                    "name": Oreo,
                    "sku": "CCOREO",
                    "price": 4.5,
                    "show_in_menu": true,
                    "sort": 1
                }
            ],
            "modifiers": [
            ]
        }
    ]
}

4.2 Retrieve all Modifiers

Returns a list of all modifiers of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/modifiers?location_id={location_id}

URL Parameters
  • location_id
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show modifiers last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{modifier_id}",
            "name": "Ice Level",
            "min_selection": 0, - null represents optional
            "max_selection": 1, - null represents unlimited
            "sort": 0,
            "updated_at": "2018-03-08T13:00:00+08:00",
            "modifier_options": [
                {
                    "id": "{modifier_option_id}",
                    "name": "No Ice",
                    "price": 1,
                    "max_qty": 1,
                    "default_selected": false,
                    "show_in_menu": true,
                    "sort": 0
                },
                {
                    "id": "{modifier_option_id}",
                    "name": "Less Ice",
                    "price": 0.5,
                    "max_qty": 1,
                    "default_selected": false,
                    "show_in_menu": true,
                    "sort": 1
                },
                {
                    "id": "{modifier_option_id}",
                    "name": "More Ice",
                    "price": 0,
                    "max_qty": 1,
                    "default_selected": false,
                    "show_in_menu": true,
                    "sort": 2
                }
            ]
        },
        {
            "id": "{modifier_id}",
            "name": "Steak Doneness",
            "min_selection": 1, - null represents optional
            "max_selection": 1, - null represents unlimited
            "sort": 1,
            "updated_at": "2018-03-08T13:00:00+08:00",
            "modifier_options": [
                {
                    "id": "{modifier_option_id}",
                    "name": "Medium Rare",
                    "price": 0,
                    "max_qty": 1,
                    "default_selected": true,
                    "show_in_menu": true,
                    "sort": 0
                },
                {
                    "id": "{modifier_option_id}",
                    "name": "Medium",
                    "price": 0,
                    "max_qty": 1,
                    "default_selected": false,
                    "show_in_menu": true,
                    "sort": 1
                },
                {
                    "id": "{modifier_option_id}",
                    "name": "Well Done",
                    "price": 0,
                    "max_qty": 1,
                    "default_selected": false,
                    "show_in_menu": true,
                    "sort": 2
                }
            ]
        }
    ]
}

4.3 Retrieve all Categories

Returns a list of all categories of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/categories

URL Parameters
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show modifiers last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{category_id}",
            "name": "Food",
            "parent_category": "{category_id}",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{category_id}",
            "name": "Sides",
            "parent_category": "{category_id}",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{category_id}",
            "name": "Drinks",
            "parent_category": "{category_id}",
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

4.4 Retrieve all Discounts

Returns a list of all discounts of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/discounts?location_id={location_id}

URL Parameters
  • location_id
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show discounts last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{discount_id}",
            "name": "Staff Discount",
            "type": "percent", - Can be either "percent" or "price" discount
            "manufacturer_discount": true, - Manufacturer discount will be applied after charges and taxes
            "value": 10, - Since discount type is percent, it is 10% discount. If value is null, it means it is an open discount and value can be custom defined.
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{discount_id}",
            "name": "First-Timer Discount",
            "type": "price",
            "manufacturer_discount": true,
            "value": 15, - Since discount type is price, it is a $15 discount
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{discount_id}",
            "name": "Open Discount",
            "type": "price",
            "manufacturer_discount": false,
            "value": null, - Open discount, value can be defined later during 9.1 Cart Summary, 9.2 Place Order or 10.3 Update Order
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

5. Online Menu

Returns a list of all menus of the location including the item data.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/menu?location_id={location_id}

Header
Authorization: Bearer {access_token}

Response
{
    "data": {
        "menus": [
            {
                "id": "{menu_id}",
                "name": "All-Day Promotion Menu",
                "sort": 0,
                "items": [
                    {
                        "id": "{item_id}",
                        "item_no": "A1",
                        "name": "Chargrilled Chicken Burger",
                        "description": "Grilled chicken with BBQ sauce", - optional, max 100 characters
                        "sort": 0,
                        "image": "https://cdn.dinlr.com/......jpg", - optional
                        "category": "{category_id}",
                        "variants": [
                            {
                                "id": "{variant_id}",
                                "name": "Regular",
                                "sku": "CKREG",
                                "price": 9.5,
                                "show_in_menu": true,
                                "sort": 0
                            },
                            {
                                "id": "{variant_id}",
                                "name": "Large",
                                "sku": "CKLAR",
                                "price": 12.5,
                                "show_in_menu": true,
                                "sort": 1
                            },
                            {
                                "id": "{variant_id}",
                                "name": "Open Price",
                                "sku": null,
                                "show_in_menu": false,
                                "sort": 2
                            }
                        ],
                        "modifiers": [
                            {
                                "id": "{modifier_id}"
                            }
                        ]
                    },
                    {
                        "id": "{item_id}",
                        "item_no": null,
                        "name": "Cheesecake",
                        "description": null,
                        "sort": 1,
                        "image": null,
                        "category": "{category_id}",
                        "variants": [
                            {
                                "id": "{variant_id}",
                                "name": "Blueberry",
                                "sku": "CCBLUE",
                                "price": 3.5,
                                "show_in_menu": true,
                                "sort": 0
                            },
                            {
                                "id": "{variant_id}",
                                "name": "Oreo",
                                "sku": "CCOREO",
                                "price": 4.5,
                                "show_in_menu": true,
                                "sort": 1
                            }
                        ],
                        "modifiers": [
                        ]
                    }
                ],
                "times": [
                    {
                        "day": Monday,
                        "start_time": "11:00",
                        "end_time": "22:00"
                    },
                    {
                        "day": Tuesday,
                        "start_time": "11:00",
                        "end_time": "22:00"
                    },
                    {
                        "day": Wednesday,
                        "start_time": "11:00",
                        "end_time": "22:00"
                    },
                    {
                        "day": Thursday,
                        "start_time": "11:00",
                        "end_time": "22:00"
                    },
                    {
                        "day": Friday,
                        "start_time": "11:00",
                        "end_time": "23:30"
                    },
                    {
                        "day": "Saturday",
                        "start_time": "11:00",
                        "end_time": "23:30"
                    },
                    {
                        "day": Sunday,
                        "start_time": "11:00",
                        "end_time": "23:30"
                    }
                ]
            }
        ]
    }
}

6. Customers

6.1 Retrieve all Customers

Returns a list of all customers of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/customers

URL Parameters
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show customers last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{customer_id}",
            "reference": "A144516982", - optional, max 50 characters
            "first_name": "Mark", - optional, max 50 characters
            "last_name": "Clinton", - optional, max 50 characters
            "company_name": "Dinlr", - optional, max 50 characters
            "email": "[email protected]", - optional, max 50 characters
            "phone": "+6511221122", - optional, max 50 characters
            "dob": "1960-06-22T00:00:00+00:00", - optional, ISO 8601 date
            "gender": "M", - optional
            "address1": "10 Kaki Bukit Ave 4", - optional, max 100 characters
            "address2": "#05-73", - optional, max 100 characters
            "city": "Singapore", - optional, max 100 characters
            "country": "SG", - optional, Alpha-2 country code
            "postal": "415874", - optional, max 50 characters
            "notes": "Allergic to peanuts", - optional, max 200 characters
            "customer_group": "{customer_group_id}",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{customer_id}",
            "reference": null,
            "first_name": "Jamie",
            "last_name": null,
            "company_name": null,
            "email": "[email protected]",
            "phone": null,
            "dob": null,
            "gender": "F",
            "address1": null,
            "address2": null,
            "city": null,
            "country": null,
            "postal": null,
            "notes": null,
            "customer_group": "{customer_group_id}",
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

6.2 Create Customer

Creates a new customer for the restaurant.

To create a new customer, you must provide at least one of the following values in your request:

  • reference
  • first_name
  • last_name


POST Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/customers

Header
Authorization: Bearer {access_token}

Parameters
{
    "reference": "A144516982", - optional, max 50 characters
    "first_name": "Mark", - optional, max 50 characters
    "last_name": "Clinton", - optional, max 50 characters
    "company_name": "Dinlr", - optional, max 50 characters
    "email": "[email protected]", - optional, max 50 characters
    "phone": "+6511221122", - optional, max 50 characters
    "dob": "1960-06-22T00:00:00+00:00", - optional, ISO 8601 date
    "gender": "F", - optional
    "address1": "10 Kaki Bukit Ave 4", - optional, max 100 characters
    "address2": "#05-73", - optional, max 100 characters
    "city": "Singapore", - optional, max 100 characters
    "country": "SG", - optional, Alpha-2 country code
    "postal": "415874", - optional, max 50 characters
    "notes": "Allergic to peanuts", - optional, max 200 characters
    "customer_group": "{customer_group_id}"
}

Response
Same response as 6.5 View Customer

6.3 Update Customer

Updates a customer profile of the restaurant.


PUT Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/customers/{customer_id}

Header
Authorization: Bearer {access_token}

Parameters
{
    "reference": "A144516982", - optional, max 50 characters
    "first_name": "Mark", - optional, max 50 characters
    "last_name": "Clinton", - optional, max 50 characters
    "company_name": "Dinlr", - optional, max 50 characters
    "email": "[email protected]", - optional, max 50 characters
    "phone": "+6511221122", - optional, max 50 characters
    "dob": "1960-06-22T00:00:00+00:00", - optional, ISO 8601 date
    "gender": "F", - optional
    "address1": "10 Kaki Bukit Ave 4", - optional, max 100 characters
    "address2": "#05-73", - optional, max 100 characters
    "city": "Singapore", - optional, max 100 characters
    "country": "SG", - optional, Alpha-2 country code
    "postal": "415874", - optional, max 50 characters
    "notes": "Allergic to peanuts", - optional, max 200 characters
    "customer_group": "{customer_group_id}"
}

Response
Same response as 6.5 View Customer

6.4 Search Customers

Searches for customers of the restaurant.

Search results are sorted by created_at in descending order.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/customers/search

URL Parameters
  • email - Show customers associated with the email
  • phone - Show customers associated with the phone
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • create_at_min - Show transactions last created after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
Same response as 6.1 Retrieve all Customers

6.5 View Customer

Returns details for a single customer of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/customers/{customer_id}

Header
Authorization: Bearer {access_token}

Response
{
    "data": {
        "id": "{customer_id}",
        "reference": "A144516982", - optional, max 50 characters
        "first_name": "Mark", - optional, max 50 characters
        "last_name": "Clinton", - optional, max 50 characters
        "company_name": "Dinlr", - optional, max 50 characters
        "email": "[email protected]", - optional, max 50 characters
        "phone": "+6511221122", - optional, max 50 characters
        "dob": "1960-06-22T00:00:00+00:00", - optional, ISO 8601 date
        "gender": "M", - optional
        "address1": "10 Kaki Bukit Ave 4", - optional, max 100 characters
        "address2": "#05-73", - optional, max 100 characters
        "city": "Singapore", - optional, max 100 characters
        "country": "SG", - optional, Alpha-2 country code
        "postal": "415874", - optional, max 50 characters
        "notes": "Allergic to peanuts", - optional, max 200 characters
        "customer_group": "{customer_group_id}",
        "updated_at": "2018-03-08T13:00:00+08:00"
    }
}

6.6 Retrieve all Customer Groups

Returns a list of all customer groups of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/customer-groups

URL Parameters
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show customer groups last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{customer_group_id}",
            "name": "Bronze Member",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{customer_group_id}",
            "name": "Gold Member",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{customer_group_id}",
            "name": "Friends & Family",
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

7. Loyalty

7.1 Retrieve all Loyalty Programs

Returns a list of all loyalty programs of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/loyalty/programs

URL Parameters
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show loyalty programs last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{loyalty_program_id}",
            "name": "SteakaStar",
            "term_single": "Star",
            "term_plural": "Stars",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{loyalty_program_id}",
            "name": "Coffee Card",
            "term_single": "Stamp",
            "term_plural": "Stamps",
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

7.2 Retrieve all Members

Returns a list of all members in the loyalty program of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/loyalty/{loyalty_program_id}/members

URL Parameters
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show members last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{member_id}",
            "point": 132,
            "customer": "{customer_id}",
            "updated_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{member_id}",
            "point": 0,
            "customer": "{customer_id}",
            "updated_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

7.3 View Member

Returns details for a single member in the loyalty program of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/loyalty/{loyalty_program_id}/members/{member_id}

Header
Authorization: Bearer {access_token}

Response
{
    "data": {
        "id": "{member_id}",
        "point": 132,
        "customer": "{customer_id}",
        "updated_at": "2018-03-08T13:00:00+08:00"
    }
}

7.4 Enrol Member

Creates a new member in the loyalty program of the restaurant.

To create a new member, you must provide a mapping with the customer_id of the member.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/loyalty/{loyalty_program_id}/members

Header
Authorization: Bearer {access_token}

Parameters
{
    "customer": "{customer_id}"
}

Response
Same response as 7.4 View Member

7.5 Create Loyalty Transactions

Adds points to or subtracts points from a member in the loyalty program of the restaurant.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/loyalty/{loyalty_program_id}/transactions

Header
Authorization: Bearer {access_token}

Parameters
{
    "member": "{member_id}",
    "location": "{location_id}", - optional
    "points": 10,
    "notes": "Complimentary points", - optional, max 200 characters
}

Response
{
    "data": {
        "id": "{loyalty_program_transaction_id}",
        "member": "{member_id}",
        "location": "{location_id}", - optional
        "order": "{order_id}", - optional
        "point": 10,
        "notes": "Complimentary points", - optional, max 200 characters
        "created_at": "2018-03-08T13:00:00+08:00"
    }
}

7.6 Search Loyalty Transactions

Searches for transactions for the loyalty program of the restaurant.

Search results are sorted by created_at in descending order.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/loyalty/{loyalty_program_id}/transactions/search

URL Parameters
  • location_id - Show transactions associated with the location
  • order_id - Show transactions associated with the order
  • member_id - Show transactions associated with the member
  • app_id - Show transactions associated with the app (Set as current to show orders placed by the app currently calling the API)
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • create_at_min - Show transactions last created after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{loyalty_program_transaction_id}",
            "member": "{member_id}",
            "location": "{location_id}", - optional
            "order": "{order_id}", - optional
            "point": 15,
            "notes": "Bonus points", - optional, max 200 characters
            "created_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{loyalty_program_transaction_id}",
            "member": "{member_id}",
            "point": -10,
            "created_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

8. Store Credit

8.1 Retrieve Customer Store Credit

Returns store credit for a single customer of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/store-credit/customers/{customer_id}

Header
Authorization: Bearer {access_token}

Response
{
    "data": {
        "id": "{customer_id}",
        "store_credit": 132,
        "updated_at": "2018-03-08T13:00:00+08:00"
    }
}

8.2 Create Store Credit Transaction

Adds store credit to or subtracts store credit from a customer of the restaurant.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/store-credit/transactions

Header
Authorization: Bearer {access_token}

Parameters
{
    "customer": "{customer_id}",
    "location": "{location_id}", - optional
    "amount": 100.99,
    "notes": "Customer Service Recovery Credit", - optional, max 200 characters
}

Response
{
    "data": {
        "id": "{store_credit_transaction_id}",
        "customer": "{customer_id}",
        "location": "{location_id}", - optional
        "order": "{order_id}", - optional
        "amount": 100.99,
        "notes": "Customer Service Recovery Credit", - optional, max 200 characters
        "created_at": "2018-03-08T13:00:00+08:00"
    }
}

8.3 Search Store Credit Transactions

Searches for store credit transactions of the restaurant.

Search results are sorted by created_at in descending order.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/store-credit/transactions/search

URL Parameters
  • location_id - Show transactions associated with the location
  • order_id - Show transactions associated with the order
  • customer_id - Show transactions associated with the customer
  • app_id - Show transactions associated with the app (Set as current to show orders placed by the app currently calling the API)
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • create_at_min - Show transactions last created after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Header
Authorization: Bearer {access_token}

Response
{
    "data": [
        {
            "id": "{store_credit_transaction_id}",
            "customer": "{customer_id}",
            "location": "{location_id}", - optional
            "order": "{order_id}", - optional
            "amount": 100.99,
            "notes": "Customer Service Recovery Credit", - optional, max 200 characters
            "created_at": "2018-03-08T13:00:00+08:00"
        },
        {
            "id": "{store_credit_transaction_id}",
            "customer": "{customer_id}",
            "amount": -10,
            "created_at": "2018-03-08T13:00:00+08:00"
        }
    ]
}

8.4 Top Up Store Credit

Top up store credit to a customer of the restaurant.

Store credit transaction will be created automatically after topping up to reflect the transaction.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/store-credit/topups

Header
Authorization: Bearer {access_token}

Parameters
{
    "customer": "{customer_id}",
    "location": "{location_id}", - optional
    "topup_no": "T399009", - optional, alphanumeric, no spaces, max 10 characters, unique
    "topup_amount": 200.50,
    "payment": "{payment_id}",
    "payment_amount": 180.50
}

Response
{
    "data": {
        "id": "{store_credit_topup_id}",
        "customer": "{customer_id}",
        "location": "{location_id}",
        "topup_no": "T399009",
        "topup_amount": 200.50,
        "payment": "{payment_id}",
        "payment_amount": 180.50,
        "created_at": "2018-03-08T13:00:00+08:00"
    }
}

9. Place Order

9.1 Cart Summary

Preview order pricing without creating an order.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/cart/calculate

Header
Authorization: Bearer {access_token}

Parameters
{
    "location": "{location_id}",
    "items": [
        {
            "item": "{item_id}",
            "qty": 2,
            "notes": "Add Jalapeno", - optional, max 200 characters
            "variant": "{variant_id}",
            "price": "99.99", - optional, only include this variable for open price variant, only works on variant with no defined value
            "modifier_options": [
                {
                    "modifier_option": "{modifier_option_id}",
                    "qty": 2 - optional, default 1
                },
                {
                    "modifier_option": "{modifier_option_id}"
                }
            ],
            "discounts": [ - Item-based discount
                {
                    "discount": "{discount_id}",
                    "value": 10 - optional, only include this variable for open discount, only works on discount with no defined value
                },
                {
                    "discount": "{discount_id}"
                }
            ]
        },
        {
            "item": "{item_id}",
            "qty": 1,
            "variant": "{variant_id}"
        }
    ],
    "charges": [ - optional, only include this variable to set custom charge amount
        {
            "charge": "{charge_id}", - please make sure that this charge is applicable for the selected dining option
            "amount": 8
        }
    ],
    "discounts": [ - Order wide discount
        {
            "discount": "{discount_id}",
            "value": 10, - optional, only include this variable for open discount, only works on discount with no defined value
        },
        {
            "discount": "{discount_id}"
        }
    ],
    "payments": [
        {
            "payment": "{payment_id}",
            "receipt_no": "BC928K", - optional, alphanumeric, no spaces, max 10 characters, unique but can use current order no
            "amount": 25.55
        }
    ],
    "objects": [
        {
            "object": "{object_id}",
            "pax": 3
        }
    ],
    "loyalty_program_rewards": [
        {
            "loyalty_program_reward": "{loyalty_program_reward_id}"
        }
    ],
    "order_info": {
        "dining_option": "{dining_option_id}", - optional
        "order_no": "BC928K", - optional, alphanumeric, no spaces, max 10 characters, unique
        "order_ticket": "C23", - optional, max 50 characters
        "pax": 3, - optional, default 1
        "status": "pending", - optional, default "pending", can be either "pending" or "pending_payment"
        "notes": "Self-collect at 3.30pm later", - optional, max 200 characters
        "customer": "{customer_id}", - optional
        "first_name": "Mark", - optional, max 50 characters
        "last_name": "Clinton", - optional, max 50 characters
        "email": "[email protected]", - optional, max 50 characters
        "phone": "+6511221122", - optional, max 50 characters
        "timeslot": "{timeslot_id}", - optional, for pre-orders
        "timeslot_start": "2020-07-10T06:00:00+00:00", - optional, ISO 8601 date, for pre-orders
        "timeslot_end": "2020-07-10T06:30:00+00:00", - optional, ISO 8601 date, for pre-orders
        "delivery_zone": "{delivery_zone_id}", - optional, for delivery orders
        "address1": "10 Kaki Bukit Ave 4", - optional, max 100 characters, delivery address
        "address2": "#05-73", - optional, max 100 characters, delivery address
        "city": "Singapore", - optional, max 100 characters, delivery address
        "country": "SG", - optional, Alpha-2 country code, delivery address
        "postal": "415874", - optional, max 50 characters, delivery address
        "address_lat": 1.3383981, - optional, delivery address latitute
        "address_lng": 103.9059644, - optional, delivery address longitude
        "order_at": "2020-07-10T05:00:00+00:00" - optional, ISO 8601 date, for pre-orders, the date which this order will show up in kitchen printer and KDS
    }
}

Response
{
    "data": {
        "subtotal": 15.54,
        "total": 10.54,
        "financial_status": "paid", - Can be either "pending", "partially_paid", "paid", "partially_refunded", "refunded" or "voided"
        "items": [
            {
                "item": "{item_id}",
                "price_per": 10.3,
                "qty": 2,
                "price": 20.6,
                "variant": "{variant_id}",
                "variant_price": 9.5,
                "sort": 0,
                "modifier_options": [
                    {
                        "modifier_option": "{modifier_option_id}",
                        "price_per": 0.5,
                        "qty": 1,
                        "price": 0.5
                    },
                    {
                        "modifier_option": "{modifier_option_id}",
                        "price_per": 0.15,
                        "qty": 2,
                        "price": 0.3
                    }
                ],
                "discounts": [
                    {
                        "discount": "{discount_id}",
                        "amount": 2.06
                    },
                    {
                        "discount": "{discount_id}",
                        "amount": 1
                    }
                ]
            },
            {
                "item": "{item_id}",
                "price_per": 10,
                "qty": 1,
                "price": 10,
                "variant": "{variant_id}",
                "variant_price": 10,
                "sort": 1,
                "modifier_options": [
                ],
                "discounts": [
                ]
            }
        ],
        "discounts": [
            {
                "discount": "{discount_id}",
                "amount": 10,
            },
            {
                "discount": "{discount_id}",
                "amount": 2,
            }
        ],
        "charges": [
            {
                "charge": "{charge_id}",
                "amount": 8,
                "name": "Delivery Fee"
            }
        ],
        "taxes": [
            {
                "tax": "{tax_id}",
                "amount": 2,
                "name": "Government Tax",
                "inclusive": false
            }
        ],
        "manufacturer_discounts": [
            {
                "discount": "{discount_id}",
                "amount": 5,
            },
            {
                "discount": "{discount_id}",
                "amount": 10,
            }
        ],
        "payments": [
            {
                "payment": "{payment_id}",
                "receipt_no": "BC928K",
                "amount": 10.55
            }
        ],
        "objects": [
            {
                "object": "{object_id}",
                "pax": 4
            }
        ]
    }
}

9.2 Place Order

Creates a new order that can include information about items for purchase and settings to apply to the order.


POST Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/cart/submit

Header
Authorization: Bearer {access_token}

Parameters
Same parameters as 9.1 Cart Summary

Response
Same response as 10.2 View Order

10. Manage Order

10.1 List Order

Returns a list of all orders of the location.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/orders?location_id={location_id}

Header
Authorization: Bearer {access_token}

URL Parameters
  • location_id
  • app_id - Show orders placed by a certain app. (Set as current to show orders placed by the app currently calling the API)
  • order_no - Show orders with specific order no only
  • limit - Return up to this many results per page (default: 50) (max: 250)
  • page - Return a specific page of results (default: 1)
  • update_at_min - Show orders last updated after date (Remember to escape + sign with %2B, because + is not allowed to be used in URL)

Response
{
    "data": [
        {
            "id": "{order_id}",
            "customer": "{customer_id}",
            "order_no": "BC928K",
            "order_ticket": "C23",
            "dining_option": "{dining_option_id}",
            "updated_at": "2018-03-08T13:00:00+08:00",
            "created_at": "2018-03-08T13:00:00+08:00",
            "total": "79.06",
            "subtotal": "71.42",
            "status": "open", - Can be either "pending", "open", "closed", "cancelled", "pending_payment" or "cancelled_payment"
            "financial_status": "paid", - Can be either "pending", "partially_paid", "paid", "partially_refunded", "refunded" or "voided"
            "kitchen_status": null, - Can be either null, "fulfilled" or "partial"
            "expedite_status": null, - Can be either null, "expedited" or "partial"
            "objects": [
                {
                    "object": "{object_id}",
                    "name": "T8"
                },
                {
                    "object": "{object_id}",
                    "name": "T9"
                }
            ]
        },
        {
            "id": "{order_id}",
            "customer": "{customer_id}",
            "order_no": "AF920F",
            "order_ticket": "C22",
            "dining_option": "{dining_option_id}",
            "updated_at": "2018-03-08T13:00:00+08:00",
            "created_at": "2018-03-08T13:00:00+08:00",
            "total": "89.99",
            "subtotal": "87.99",
            "status": "closed",
            "financial_status": "pending",
            "kitchen_status": "fulfilled",
            "expedite_status": "partial",
            "objects": [
            ]
        }
    ]
}

10.2 View Order

Returns details for a single order of the restaurant.


GET Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/orders/{order_id}

Header
Authorization: Bearer {access_token}

Response
{
    "data": {
        "id": "{order_id}",
        "customer": "{customer_id}",
        "order_no": "BC928K",
        "order_ticket": "C23",
        "dining_option": "{dining_option_id}",
        "pax":4,
        "subtotal": 6.42,
        "total": 2.55,
        "status": "open", - Can be either "pending", "open", "closed", "cancelled", "pending_payment" or "cancelled_payment"
        "financial_status": "partially_refunded", - Can be either "pending", "partially_paid", "paid", "partially_refunded", "refunded" or "voided"
        "kitchen_status": null, - Can be either null, "fulfilled" or "partial"
        "expedite_status": null, - Can be either null, "expedited" or "partial"
        "notes": null, - optional, max 200 characters
        "updated_at": "2018-03-08T13:00:00+08:00",
        "created_at": "2018-03-08T13:00:00+08:00",
        "objects": [
            {
                "object": "{object_id}",
                "name": "T8"
            },
            {
                "object": "{object_id}",
                "name": "T9"
            }
        ],
        "items": [
            {
                "id": "{order_item_id}",
                "item": "{item_id}",
                "item_no": "A3",
                "price_per": 10.3,
                "qty": 2,
                "price": 20.6,
                "notes": null, - optional, max 200 characters
                "variant": "{variant_id}",
                "variant_price": 9.5,
                "sort": 0,
                "modifier_options": [
                    {
                        "modifier_option": "{modifier_option_id}",
                        "price_per": 0.5,
                        "qty": 1,
                        "price": 0.5
                    },
                    {
                        "modifier_option": "{modifier_option_id}",
                        "price_per": 0.15,
                        "qty": 2,
                        "price": 0.3
                    }
                ],
                "discounts": [
                    {
                        "discount": "{discount_id}",
                        "amount": 6.18
                    }
                ]
            },
            {
                "id": "{order_item_id}",
                "item": "{item_id}",
                "item_no": null,
                "price_per": 10,
                "qty": 1,
                "price": 10,
                "notes": null,
                "variant": "{variant_id}",
                "variant_price": 10,
                "sort": 1,
                "modifier_options": [
                ],
                "discounts": [
                ]
            }
        ],
        "discounts": [
            {
                "discount": "{discount_id}",
                "amount": 8
            }
        ],
        "charges": [
            {
                "charge": "{charge_id}",
                "amount": 0.64,
                "name": "Service Charge"
            }
        ],
        "taxes": [
            {
                "tax": "{tax_id}",
                "amount": 0.49,
                "name": "GST",
                "inclusive": false
            }
        ],
        "manufacturer_discounts": [
            {
                "discount": "{discount_id}",
                "amount": 5
            }
        ],
        "payments": [
            {
                "id": "{receipt_id}",
                "payment": "{payment_id}",
                "receipt_no": "BC928K",
                "amount": 2.55,
                "created_at": "2018-03-08T13:00:00+08:00"
            }
        ],
        "refunds": [
            {
                "id": "{refund_id}",
                "refund_no": "RFN069A",
                "amount": 0.55,
                "created_at": "2018-03-08T13:00:00+08:00",
                "refund_payments": [
                    {
                        "payment": "{payment_id}",
                        "amount": 0.30
                    },
                    {
                        "payment": "{payment_id}",
                        "amount": 0.25
                    }
                ]
            }
        ]
    }
}

10.3 Update Order

Updates an open order by adding, replacing, or deleting fields.


PUT Request
https://api.dinlr.com/v1/{restaurant_id}/onlineorder/orders/{order_id}

Header
Authorization: Bearer {access_token}

Parameters
{
    "items": [
        {
            "id": "{order_item_id}", - *NOTE* Use order item id to retain the item’s kitchen and expedite status, or it will act as a new item
            "item": "{item_id}",
            "qty": 2,
            "notes": "Add Jalapeno", - optional, max 200 characters
            "variant": "{variant_id}",
            "price": "99.99", - optional, only include this variable for open price variant, only works on variant with no defined value
            "modifier_options": [
                {
                    "modifier_option": "{modifier_option_id}",
                    "qty": 2 - optional, default 1
                },
                {
                    "modifier_option": "{modifier_option_id}"
                }
            ],
            "discounts": [ - Item-based discount
                {
                    "discount": "{discount_id}",
                    "value": 10 - optional, only include this variable for open discount, only works on discount with no defined value
                },
                {
                    "discount": "{discount_id}"
                }
            ]
        },
        {
            "id": "{order_item_id}",
            "item": "{item_id}",
            "qty": 1,
            "variant": "{variant_id}"
        },
        { - Item with no id variable will act as a new item
            "item": "{item_id}",
            "qty": 1,
            "variant": "{variant_id}"
        }
    ],
    "charges": [ - optional, only include this variable to set custom charge amount
        {
            "charge": "{charge_id}", - please make sure that this charge is applicable for the selected dining option
            "amount": 8
        }
    ],
    "discounts": [ - Order wide discount
        {
            "discount": "{discount _id}",
            "value": 10, - optional, only include this variable for open discount, only works on discount with no defined value
        },
        {
            "discount": "{discount _id}"
        }
     ],
    "payments": [ - *NOTE* ONLY include new payment, DO NOT INCLUDE existing/previous payments, leave empty if there is no new payment (Reason: Dinlr does not allow amendment of payment once it is recorded)
        {
            "payment": "{payment_id}",
            "receipt_no": "BC928K", - optional, alphanumeric, no spaces, max 10 characters, unique but can use current order no
            "amount": 25.55
        }
    ],
    "objects": [
        {
            "object": "{object_id}",
            "pax": 3
        }
    ],
    "loyalty_program_rewards": [
        {
            "loyalty_program_reward": "{loyalty_program_reward_id}"
        }
    ],
    "order_info": {
        "dining_option": "{dining_option_id}", - optional
        "order_no": "BC928K", - optional, alphanumeric, no spaces, max 10 characters, unique, leave empty to use previous order_no
        "order_ticket": "C23", - optional, max 50 characters, leave empty to use previous order_ticket
        "pax": 3, - optional, leave empty to use previous pax
        "status": "pending", - optional, leave empty to use previous status
        "notes": "Self-collect at 3.30pm later", - optional, max 200 characters
        "customer": "{customer_id}", - optional
        "first_name": "Mark", - optional, max 50 characters
        "last_name": "Clinton", - optional, max 50 characters
        "email": "[email protected]", - optional, max 50 characters
        "phone": "+6511221122", - optional, max 50 characters
        "timeslot": "{timeslot_id}", - optional, for pre-orders
        "timeslot_start": "2020-07-10T06:00:00+00:00", - optional, ISO 8601 date, for pre-orders
        "timeslot_end": "2020-07-10T06:30:00+00:00", - optional, ISO 8601 date, for pre-orders
        "delivery_zone": "{delivery_zone_id}", - optional, for delivery orders
        "address1": "10 Kaki Bukit Ave 4", - optional, max 100 characters, delivery address
        "address2": "#05-73", - optional, max 100 characters, delivery address
        "city": "Singapore", - optional, max 100 characters, delivery address
        "country": "SG", - optional, Alpha-2 country code, delivery address
        "postal": "415874", - optional, max 50 characters, delivery address
        "address_lat": 1.3383981, - optional, delivery address latitute
        "address_lng": 103.9059644, - optional, delivery address longitude
        "order_at": "2020-07-10T05:00:00+00:00" - optional, ISO 8601 date, for pre-orders, the date which this order will show up in kitchen printer and KDS, leave empty to use previous order_at
    }
}

Response
Same response as 10.2 View Order

10.4 Change Order Status

Updates an open order status.


POST Request

Closes an order. Cannot be performed on cancelled orders.


https://api.dinlr.com/v1/{restaurant_id}/onlineorder/orders/{order_id}/close

Re-opens an order. Cannot be performed on cancelled orders.


https://api.dinlr.com/v1/{restaurant_id}/onlineorder/orders/{order_id}/open

Cancels an order. Cannot be performed on orders with transactions (payments or refunds).


https://api.dinlr.com/v1/{restaurant_id}/onlineorder/orders/{order_id}/cancel

Header
Authorization: Bearer {access_token}

Response
Same response as 10.2 View Order