Orders
HTTP Methods
ENDPOINT | HTTP METHODS | DESCRIPTION |
---|---|---|
/orders | POST, PUT | Creates a new order. |
/orders/{ORDER_ID} | GET | Gets a given order’s details by ID. |
/orders/{ORDER_ID}/items | POST, PUT | Adds a menu item to an order. |
/orders/{ORDER_ID}/items/{ORDERED_ITEM_ID} | DELETE | Deletes an item from an order. |
/orders/{ORDER_ID}/items/{ORDERED_ITEM_ID}/delete | POST, PUT | Deletes an item from an order (same as above). Made to support HTTP clients that cannot use DELETE. |
Examples
http://api.opendining.net/orders<br> http://api.opendining.net/orders/4b96f1bafc9f100ca79231ef<br> http://api.opendining.net/orders/4b96f1bafc9f100ca79231ef/items<br> http://api.opendining.net/orders/4b96f1bafc9f100ca79231ef/items/4b96f1bafd9f100ca79231dd
Order Properties
PROPERTY NAME | TYPE | DESCRIPTION |
---|---|---|
id | String (MongoDB ID) | The order’s ID. |
restaurant | String (MongoDB ID) | The restaurant’s ID. |
name | String | The name of the restaurant to which this order will be submitted. |
payment_options | String | The payment_options value from the restaurant. |
creation_time | Date | Creation timestamp. |
status | String | A text status of the order. This is highly variable. |
s | Integer | An integer representing the order’s status. |
paid | Boolean | True if the order has been paid, false if not. |
type | String | Either takeout or delivery. |
submit_url | String | The URL where you send the customer when they’re ready to submit the order. |
Order Status
An order contains two fields that relate to its status: “status” and “s.” The “status” field is a highly variable string that is meant to communicate information from a restaurant back to a consumer. You cannot rely on its value in your application. For example, a restaurant may choose to set a status value of: “Dave is making you a delicious sandwich.”
The numeric field “s” is used for reliable system statuses. The following table describes the possible values of s.
VALUE OF “S” | MEANING |
---|---|
0 | The order has not yet been submitted. |
1 | The order has been submitted, but has not yet been completed by the restaurant. |
2 | The order has been marked complete by the restaurant. |
Note: An order may be marked as complete any time the restaurant has completed workflow within Paytronix Online Ordering. For example, some restaurants do not have internet-enabled terminals available to update order statuses. If a restaurant only receives our orders via a fax machine, the orders are set to “complete” once the fax is successfully delivered.