A python library for the ordr.in API. See full API documentation at http://hackfood.ordr.in
- Installation
- Usage
-
- Guest Order (
order_guest
) - User Order (
order_user
)
- Guest Order (
-
- Delivery Check (
delivery_check
) - Delivery List (
delivery_list
) - Fee (
fee
) - Restaurant Details (
restaurant_details
)
- Delivery Check (
-
- Change Password (
change_password
) - Create Account (
create_account
) - Create Address (
create_addr
) - Create Credit Card (
create_cc
) - Remove address (
delete_addr
) - Remove Credit Card (
delete_cc
) - Get Account Information (
get_account_info
) - Get All Saved Addresses (
get_all_saved_addrs
) - Get all saved credit cards (
get_all_saved_ccs
) - Get an Order (
get_order
) - Get Order History (
get_order_history
) - Get a single saved address (
get_saved_addr
) - Get a single saved credit card (
get_saved_cc
)
- Change Password (
This library can be installed with pip:
pip install ordrin
import ordrin
ordrin_api = ordrin.APIs(api_key, servers)
In the initializer, the second argument sets the servers that API requests will
be sent to, and must be set to either ordrin.PRODUCTION
or ordrin.TEST
(defaults to ordrin.TEST
).
Order Endpoints (API Reference)
Guest Order (API Reference)
ordrin.order_guest(rid, em, tray, tip, first_name, last_name, phone, zip, addr, city, state, card_number, card_cvc, card_expiry, card_bill_addr, card_bill_city, card_bill_state, card_bill_zip, card_bill_phone, addr2=None, card_name=None, card_bill_addr2=None, delivery_date=None, delivery_time=None)
rid
: Ordr.in's unique restaurant identifier for the restaurant. (A number)em
: The customer's email addresstray
: Represents a tray of menu items in the format '[menu item id]/[qty],[option id],...,[option id]'tip
: Tip amount in dollars and centsfirst_name
: The customer's first namelast_name
: The customer's last namephone
: The customer's phone numberzip
: The zip code part of the address (5 digits)addr
: The street addressaddr2
: The second part of the street address, if neededcity
: The city part of the addressstate
: The state part of the address (Two letters)card_name
: Full name as it appears on the credit cardcard_number
: Credit card number (16 digits)card_cvc
: 3 or 4 digit security code (3 or 4 digits)card_expiry
: The credit card expiration date. (mm/yyyy)card_bill_addr
: The credit card's billing street addresscard_bill_addr2
: The second part of the credit card's biling street address.card_bill_city
: The credit card's billing citycard_bill_state
: The credit card's billing state (2 letters)card_bill_zip
: The credit card's billing zip code (5 digits)card_bill_phone
: The credit card's billing phone number
delivery_date
: Delivery date (mm-dd)delivery_time
: Delivery time (HH:MM)
delivery_date
: Delivery date (ASAP)
User Order (API Reference)
ordrin.order_user(rid, tray, tip, first_name, last_name, email, current_password, phone=None, zip=None, addr=None, addr2=None, city=None, state=None, nick=None, card_name=None, card_number=None, card_cvc=None, card_expiry=None, card_bill_addr=None, card_bill_addr2=None, card_bill_city=None, card_bill_state=None, card_bill_zip=None, card_bill_phone=None, card_nick=None, delivery_date=None, delivery_time=None)
rid
: Ordr.in's unique restaurant identifier for the restaurant. (A number)tray
: Represents a tray of menu items in the format '[menu item id]/[qty],[option id],...,[option id]'tip
: Tip amount in dollars and centsfirst_name
: The customer's first namelast_name
: The customer's last nameemail
: The user's email addresscurrent_password
: The user's current password
addr
: The street addressaddr2
: The second part of the street address, if neededcity
: The city part of the addressphone
: The customer's phone numberstate
: The state part of the address (Two letters)zip
: The zip code part of the address (5 digits)
nick
: The delivery location nickname. (From the user's addresses)
card_bill_addr
: The credit card's billing street addresscard_bill_addr2
: The second part of the credit card's biling street address.card_bill_city
: The credit card's billing citycard_bill_phone
: The credit card's billing phone numbercard_bill_state
: The credit card's billing state (2 letters)card_bill_zip
: The credit card's billing zip code (5 digits)card_cvc
: 3 or 4 digit security code (3 or 4 digits)card_expiry
: The credit card expiration date. (mm/yyyy)card_name
: Full name as it appears on the credit cardcard_number
: Credit card number (16 digits)
card_nick
: The credit card nickname. (From the user's credit cards)
delivery_date
: Delivery date (mm-dd)delivery_time
: Delivery time (HH:MM)
delivery_date
: Delivery date (ASAP)
Restaurant Endpoints (API Reference)
Delivery Check (API Reference)
ordrin.delivery_check(datetime, rid, addr, city, zip)
datetime
: Delivery date and time (ASAP or mm-dd+HH:MM)rid
: Ordr.in's unique restaurant identifier for the restaurant. (A number)addr
: Delivery location street addresscity
: Delivery location cityzip
: The zip code part of the address (5 digits)
Delivery List (API Reference)
ordrin.delivery_list(datetime, addr, city, zip)
datetime
: Delivery date and time (ASAP or mm-dd+HH:MM)addr
: Delivery location street addresscity
: Delivery location cityzip
: The zip code part of the address (5 digits)
Fee (API Reference)
ordrin.fee(datetime, rid, subtotal, tip, addr, city, zip)
datetime
: Delivery date and time (ASAP or mm-dd+HH:MM)rid
: Ordr.in's unique restaurant identifier for the restaurant. (A number)subtotal
: The cost of all items in the tray in dollars and cents.tip
: The tip in dollars and cents.addr
: Delivery location street addresscity
: Delivery location cityzip
: The zip code part of the address (5 digits)
Restaurant Details (API Reference)
ordrin.restaurant_details(rid)
rid
: Ordr.in's unique restaurant identifier for the restaurant. (A number)
User Endpoints (API Reference)
Change Password (API Reference)
ordrin.change_password(email, password, current_password)
email
: The user's email addresspassword
: The user's new password (SHA256 hex encoded)current_password
: The user's current password
Create Account (API Reference)
ordrin.create_account(email, pw, first_name, last_name)
email
: The user's email addresspw
: The user's passwordfirst_name
: The user's first namelast_name
: The user's last name
Create Address (API Reference)
ordrin.create_addr(email, nick, phone, zip, addr, city, state, current_password, addr2=None)
email
: The user's email addressnick
: The nickname of this addressphone
: The customer's phone numberzip
: The zip code part of the address (5 digits)addr
: The street addressaddr2
: The second part of the street address, if neededcity
: The city part of the addressstate
: The state part of the address (Two letters)current_password
: The user's current password
Create Credit Card (API Reference)
ordrin.create_cc(email, nick, card_number, card_cvc, card_expiry, bill_addr, bill_city, bill_state, bill_zip, bill_phone, current_password, bill_addr2=None)
email
: The user's email addressnick
: The nickname of this addresscard_number
: Credit card number (16 digits)card_cvc
: 3 or 4 digit security code (3 or 4 digits)card_expiry
: The credit card expiration date. (Two digits/Four digits)bill_addr
: The credit card's billing street addressbill_addr2
: The second part of the credit card's biling street address.bill_city
: The credit card's billing citybill_state
: The credit card's billing state (2 letters)bill_zip
: The credit card's billing zip code (5 digits)bill_phone
: The credit card's billing phone numbercurrent_password
: The user's current password
Remove address (API Reference)
ordrin.delete_addr(email, nick, current_password)
email
: The user's email addressnick
: The nickname of this addresscurrent_password
: The user's current password
Remove Credit Card (API Reference)
ordrin.delete_cc(email, nick, current_password)
email
: The user's email addressnick
: The nickname of this addresscurrent_password
: The user's current password
Get Account Information (API Reference)
ordrin.get_account_info(email, current_password)
email
: The user's email addresscurrent_password
: The user's current password
Get All Saved Addresses (API Reference)
ordrin.get_all_saved_addrs(email, current_password)
email
: The user's email addresscurrent_password
: The user's current password
Get all saved credit cards (API Reference)
ordrin.get_all_saved_ccs(email, current_password)
email
: The user's email addresscurrent_password
: The user's current password
Get an Order (API Reference)
ordrin.get_order(email, oid, current_password)
email
: The user's email addressoid
: Ordr.in's unique order id number. (A number)current_password
: The user's current password
Get Order History (API Reference)
ordrin.get_order_history(email, current_password)
email
: The user's email addresscurrent_password
: The user's current password
Get a single saved address (API Reference)
ordrin.get_saved_addr(email, nick, current_password)
email
: The user's email addressnick
: The nickname of this addresscurrent_password
: The user's current password
Get a single saved credit card (API Reference)
ordrin.get_saved_cc(email, nick, current_password)
email
: The user's email addressnick
: The nickname of this addresscurrent_password
: The user's current password