/customer/order_history

This can be used to get order history of an customer.

/customer/order_history/list

Returns list of orders customer has done.

Request

POST nameValueRequired?
session_idhash returned by loginYes
restaurant_id774No

restaurant_id can be used to get orders only to specific restaurant.

Response

With minimal data set:

[
    {
        "address":{
            "name":"Amu Hinamori",
            "address":"Foobar 1",
            "postal_code":"04230",
            "city":"Kerava"
        },
        "delivery_method":"fetch",
        "delivery_fee":"0.00",
        "restaurant_name":"Old Restaurant",
        "restaurant_id":"774",
        "payment_method":"cash",

        "comment":"Order creation time",
        "timestamp":"1316169937",

        "order_number":"1316169937",
        "email":"[email protected]",
        "phone_number":"0505640847"
        "alternative_delivery_time":"1316169999",

        "comment":"If restaurant promised specific time when order should be ready to be fetched or when it is delivered to customer, this is set. Otherwise empty.",
        "restaurant_promised_delivery_after":30,

        "total_price":"19"
    },
    "more ..."
]

Expectable errors

See error conventions section for explanation how error system works.

Label Additional data Description
NO_ORDERSNone

Customer does not have any orders. This means that customer can’t do a regular cash order.

The message in response can be shown when trying to look the history and in a case the customer is trying to do an order to restaurant which has regular_cash on and customer does not have orders (this error is returned).

INVALID_RESTAURANT_IDNoneDon’t try to give me invalid data, please :(

/customer/order_history/get

If customer wants to see more comprehensive data of an order, this is right thing to utilize.

Allows fetching of certain order’s products, prices and other similar information.

Request

POST nameValueRequired?
order_idintegerYes
basic_databooleanNo
session_idhash returned by loginYes

basic_data

This is by default false.

If this is true, same data as with /customer/order_history/list is returned in the response. If you have already done /customer/order_history/list call, you may be able to save that data locally, so you don’t need to refetch that data when getting product data of orders. Omitting that basic data would make response of this action faster and smaller.

Response

{
  "items":[
    {
    "product_id":"1",
    "name":"Product Name",
    "size":"Extra Large",
    "amount":"2",
    "comment":"Price of one product/item of an order",
    "selling_price":"9.5",
    "additional_info":"Product specific information by the customer here",
    "ingredients":[
      553543, 2332, 643353
    ],
    "changed_ingredients":[
      {
        "from":457045,
        "to":4595
      }
    ],
    "added_ingredients":[
      54353, 23516
    ],
    "added_free_ingredients":[
      14555556
    ],
    "extras":[
      9252, 5222
    ],
    "side_dish":null,
    "lunch_time_side_dish":5033
    }
  ],

  "restaurant_id":774
}

Expectable errors

Label Additional data Description
INVALID_ORDER_IDidentifier, order_idProblem in client.
INVALID_BASIC_DATANoneIn case order data passed was not true or false.