Developers

GET API KEY

User


For testing purposes please use this domain - https://u-test.ordr.in/
When in production use this domain - https://u.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.

Account Settings
GET Get Account Information
/u/[email]
Parameter Value Description
email The user's email address
pw The user's password, SHA256 encoded (this form encodes it for you)

It returns a JSON hash. Each hash contains these fields:

first_name:The user's first name
last_name:The user's first name
em:The user's email
POSTCreate New Account
/u/[email]

You must pass in the following fields in the POST data (in standard x-www-form-urlencoded format):

Parameter Value Description
email The user's email address
first_name The user's first name
last_name The user's last name
pw The user's password, SHA256 encoded (this form encodes it for you)

It returns a JSON hash with this data:

_errora boolean (0|1), 1 means there was an error, 0 means it was successful
msgthe error message
Addresses
GETGet all saved addresses
/u/[email]/addrs
Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)

It returns a JSON array of hashes. Each hash represents a saved address and contains these fields:

nick:The nickname of this address (i.e. Home, Work)
addr:The street address
addr2:The 2nd line of the address (optional)
city:The city
state:The state
zip:The zip code
phone:The phone number
GETGet a single saved address
/u/[email]/addrs/[nick]
Parameter Value Description
email The user's email address
nick The nickname of this address(i.e. Home, Work)
password The user's password, SHA256 encoded (this form encodes it for you)
nick:The nickname of this address (i.e. Home, Work)
addr:The street address
addr2:The 2nd line of the address (optional)
city:The city
state:The state
zip:The zip code
phone:The phone number
POSTAdd/Edit a single saved addresses: this will overwrite any existing data.
/u/[email]/addrs/[nick]

You must pass in the following fields in the PUT data (in standard x-www-form-urlencoded format):

Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)
nick The nickname of this address(i.e. Home, Work)
addr The street address
addr2 The 2nd line of the address (optional)
city The city
state The state, in standard postal code abbreviations, e.x: FL
zip The zip
phone The user's phone number.

It returns a JSON hash with this data:

_errora boolean (0|1), 1 means there was an error, 0 means it was successful
msgthe error message
DELETERemove an address from the user's saved addresses.
/u/[email]/addrs/[nick]
Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)
nick The nickname of this address(i.e. Home, Work)

It returns a JSON hash with this data:

_errora boolean (0|1), 1 means there was an error, 0 means it was successful
msgthe error message
Credit Cards
GETGet all saved credit cards
/u/[email]/ccs
Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)

It returns a JSON array of hashes. Each hash represents a saved address and contains these fields:

nick:The nickname of the card
name:The name on the card.
cc_last5:The last 5 digits of the card
expiry_month:The 2 digit expiry month (i.e. 01 = January, 12 = December)
expiry_year:The 4 digit expiry year
type:The type of card (i.e. American Express)
bill_addr:The billing address
bill_addr2:The second line of the billing address (optional)
bill_city:The billing city
bill_state:The billing state
bill_zip:The billing zip
GETGet a single saved credit cards
/u/[email]/ccs/[nick]
Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)
nick The nickname of the credit card

It returns a JSON hash with a single fixed key "cc". The value of cc is a hash that contains these fields:

name:The name on the card.
cc_last5:The last 5 digits of the card
expiry_month:The 2 digit expiry month (i.e. 01 = January, 12 = December)
expiry_year:The 4 digit expiry year
type:The type of card (i.e. American Express)
bill_addr:The billing address
bill_addr2:The second line of the billing address (optional)
bill_city:The billing city
bill_state:The billing state
bill_zip:The billing zip
PUTAdd/Edit a single saved credit cards: this will overwrite any existing data.
/u/[email]/ccs/[nick]

You must pass in the following fields in the PUT data (in standard x-www-form-urlencoded format):

Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)
nick The nickname of the credit card
name The name on the card
number The 15 or 16 digit credit card number, no spaces or punctuation.
cvc The 3 or 4 digit security code
expiry_month The 3 or 4 digit security code
exipry_year The 4 digit expiry year
bill_addr The billing address
bill_addr2 The second line of the billing address(optional)
bill_city The billing city
bill_state The billing state, in standard postal code abbreviations, e.x: FL
bill_zip The billing zip
phone The user's phone number

It returns a JSON hash with this data:

_errora boolean (0|1), 1 means there was an error, 0 means it was successful
msgthe error message
DELETERemove a credit card from the user's saved cards.
/u/[email]/ccs/[nick]
Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)
nick The nickname of the credit card

It returns a JSON hash with this data:

_errora boolean (0|1), 1 means there was an error, 0 means it was successful
msgthe error message
Order History Summary
GETGet a list of previous orders, summary data
/u/[email]/orders
Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)

It returns a JSON array of hashes, where each hash represents an order with this format:

oidThe order ID
ridThe restaurant ID
rnameThe restaurant name
totalThe total cost in dollars.
tipThe tip in dollars.
ctimeThe time (in UTC) of the order in unix time.
itemThis is an array of hashes, each hash represents an item ordered.
 
nameThe name of the item
idThe id of the item
priceThe price of the item in cents
qtyThe quantity ordered
optsAn array of hashes, each hash represents an option ordered with the main item. Each option is of the same format as the item
Order History Detail
GETGet details of a specific order
/u/[email]/order/[oid]
Parameter Value Description
email The user's email address
password The user's password, SHA256 encoded (this form encodes it for you)
oid The order ID

It returns a JSON array of hashes, where each hash represents an order with this format:

oidThe order ID
ridThe restaurant ID
rnameThe restaurant name
totalThe total cost in dollars.
tipThe tip in dollars.
ctimeThe time (in UTC) of the order in unix time.
itemThis is an array of hashes, each hash represents an item ordered.
 
nameThe name of the item
idThe id of the item
priceThe price of the item in cents
qtyThe quantity ordered
optsAn array of hashes, each hash represents an option ordered with the main item. Each option is of the same format as the item
Password
PUTUpdate the user's password
/u/[email]/password
Parameter Value Description
email The user's email address
password The SHA256 digested password, hex encoded (this form encodes the password automatically)
previous_password The SHA256 digested old password, hex encoded (this form encodes the password automatically)
password:The SHA256 digested password, hex encoded

It returns a JSON hash with this data:

_errora boolean (0|1), 1 means there was an error, 0 means it was successful
msgthe error message

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