Developers

GET API KEY

Order API:


For testing purposes please use this domain - https://o-test.ordr.in/
When in production use this domain - https://o.ordr.in/


Authentication

All user requests (besides user creation) must be authenticated with the user's password. Authenticated requests simply have an additional HTTP header:

X-NAAMA-AUTHENTICATION: username="[email]", response="[hash code]", version="1"

The hash code above is a SHA256 digest, hex encoded, of a few pieces of information about the request.

hashcode = SHA256( SHA256([password]) + [email] + [uri] )

Notice that the password is first SHA256 digested, it is never sent across in clear text. The URI does not include the domain, so it would be something like /u/test@example.com . NB this authentication is in addition to the standard client authentication.

POSTOrder: Order a tray of items
/o/[restaurant id]
Parameter Value Description
restaurant id Ordr.in's restaurant identifier
tray The tray is composed of menu items and optional sub-items. A single menu item's format is:
[menu item id]/[qty],[option id],[option id]...
Multiple menu items are joined by a +:
[menu item id]/[qty]+[menu item id2]/[qty2]
For example:
3270/2+3263/1,3279
Means 2 of menu item 3270 (with no sub options) and 1 of item num 3263 with sub option 3279.
tip amount of tip in dollars and cents
delivery_date either ASAP or in the date format 2 digit month - 2 digit date, i.e. January 21 would be 01-21
delivery_time required if delivery_date is not ASAP, is of the format 2 digit hour (24 hour time) and 2 digit minutes, i.e. 9:30 PM would be 21:30
first_name first name of customer
last_name last name of customer
addr street address of delivery
city city of delivery
state 2 letter state of delivery
zip 5 digit zip code of delivery
phone 10 digit phone number, format ###-###-####
em email address of customer
password You can create a new account with the included email by providing a SHA encoded password. (this form encodes it for you)
card_name full name of customer as appears on card
card_number customer's credit card number
card_cvc 3 digit (or 4 if it's an AMEX) credit card security code
card_expiry customer's credit card expiration in mm/yyyy format
card_bill_addr customer's credit card billing street address
card_bill_addr2 (optional) customer's credit card billing street address 2nd line
card_bill_city customer's credit card billing city
card_bill_state 2 letter state code for customer's credit card billing state
card_bill_zip Customer's credit card billing 5 digit postal code

Clicking this submit button redirects you to either ordr.in/success or ordr.in/failure, you will be able to see the return values in the url.

It returns JSON, on a successful order it will return

{ "_error":0, "order_id":"xxxxxxx" }

order_id: ordr.in's reference number for that order.

On an error it returns

{ "_error":1, "msg": "..." , "text":"..." }

The msg will be either:

  • failed order: this indicates that something has gone wrong and the cc was not charged nor was the order passed to the restaurant
  • transaction failed: this indicates an issue with creating a user (applicable only if ordr.in is handling user account management)

The text will be something end user viewable:

  • If there are errors from the credit card processor we indicate what the error was
  • Data validation errors "Please re-enter your address"
  • Internal errors - generic errors when something has gone wrong in our internal processing

To better direct you please tell us what kind of business you are: