Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 ordrin
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 VERSION.txt
Octocat-spinner-32 test.php
README.md

Ordr.in Php Library

A php library for the ordr.in API. See full API documentation at http://hackfood.ordr.in

Table of Contents

Installation

Just download the zip file of this repo and unzip it into your project directory.

Usage

Initialization

use Ordrin;
$ordrin_api = new 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::APIs::PRODUCTION or Ordrin::APIs::TEST (defaults to Ordrin::APIs::TEST).

Order Endpoints (API Reference)

Guest Order (API Reference)

$ordrin_api->order_guest(args)
Arguments
  • args["rid"] : Ordr.in's unique restaurant identifier for the restaurant. (A number)
  • args["em"] : The customer's email address
  • args["tray"] : Represents a tray of menu items in the format '[menu item id]/[qty],[option id],...,[option id]'
  • args["tip"] : Tip amount in dollars and cents
  • args["first_name"] : The customer's first name
  • args["last_name"] : The customer's last name
  • args["phone"] : The customer's phone number
  • args["zip"] : The zip code part of the address (5 digits)
  • args["addr"] : The street address
  • args["addr2"] : The second part of the street address, if needed
  • args["city"] : The city part of the address
  • args["state"] : The state part of the address (Two letters)
  • args["card_name"] : Full name as it appears on the credit card
  • args["card_number"] : Credit card number (16 digits)
  • args["card_cvc"] : 3 or 4 digit security code (3 or 4 digits)
  • args["card_expiry"] : The credit card expiration date. (mm/yyyy)
  • args["card_bill_addr"] : The credit card's billing street address
  • args["card_bill_addr2"] : The second part of the credit card's biling street address.
  • args["card_bill_city"] : The credit card's billing city
  • args["card_bill_state"] : The credit card's billing state (2 letters)
  • args["card_bill_zip"] : The credit card's billing zip code (5 digits)
  • args["card_bill_phone"] : The credit card's billing phone number
Either
  • args["delivery_date"] : Delivery date (mm-dd)
  • args["delivery_time"] : Delivery time (HH:MM)
Or
  • args["delivery_date"] : Delivery date (ASAP)

User Order (API Reference)

$ordrin_api->order_user(args)
Arguments
  • args["rid"] : Ordr.in's unique restaurant identifier for the restaurant. (A number)
  • args["tray"] : Represents a tray of menu items in the format '[menu item id]/[qty],[option id],...,[option id]'
  • args["tip"] : Tip amount in dollars and cents
  • args["first_name"] : The customer's first name
  • args["last_name"] : The customer's last name
  • args["email"] : The user's email address
  • args["current_password"] : The user's current password
Either
  • args["addr"] : The street address
  • args["addr2"] : The second part of the street address, if needed
  • args["city"] : The city part of the address
  • args["phone"] : The customer's phone number
  • args["state"] : The state part of the address (Two letters)
  • args["zip"] : The zip code part of the address (5 digits)
Or
  • args["nick"] : The delivery location nickname. (From the user's addresses)
Either
  • args["card_bill_addr"] : The credit card's billing street address
  • args["card_bill_addr2"] : The second part of the credit card's biling street address.
  • args["card_bill_city"] : The credit card's billing city
  • args["card_bill_phone"] : The credit card's billing phone number
  • args["card_bill_state"] : The credit card's billing state (2 letters)
  • args["card_bill_zip"] : The credit card's billing zip code (5 digits)
  • args["card_cvc"] : 3 or 4 digit security code (3 or 4 digits)
  • args["card_expiry"] : The credit card expiration date. (mm/yyyy)
  • args["card_name"] : Full name as it appears on the credit card
  • args["card_number"] : Credit card number (16 digits)
Or
  • args["card_nick"] : The credit card nickname. (From the user's credit cards)
Either
  • args["delivery_date"] : Delivery date (mm-dd)
  • args["delivery_time"] : Delivery time (HH:MM)
Or
  • args["delivery_date"] : Delivery date (ASAP)

Restaurant Endpoints (API Reference)

Delivery Check (API Reference)

$ordrin_api->delivery_check(args)
Arguments
  • args["datetime"] : Delivery date and time (ASAP or mm-dd+HH:MM)
  • args["rid"] : Ordr.in's unique restaurant identifier for the restaurant. (A number)
  • args["addr"] : Delivery location street address
  • args["city"] : Delivery location city
  • args["zip"] : The zip code part of the address (5 digits)

Delivery List (API Reference)

$ordrin_api->delivery_list(args)
Arguments
  • args["datetime"] : Delivery date and time (ASAP or mm-dd+HH:MM)
  • args["addr"] : Delivery location street address
  • args["city"] : Delivery location city
  • args["zip"] : The zip code part of the address (5 digits)

Fee (API Reference)

$ordrin_api->fee(args)
Arguments
  • args["datetime"] : Delivery date and time (ASAP or mm-dd+HH:MM)
  • args["rid"] : Ordr.in's unique restaurant identifier for the restaurant. (A number)
  • args["subtotal"] : The cost of all items in the tray in dollars and cents.
  • args["tip"] : The tip in dollars and cents.
  • args["addr"] : Delivery location street address
  • args["city"] : Delivery location city
  • args["zip"] : The zip code part of the address (5 digits)

Restaurant Details (API Reference)

$ordrin_api->restaurant_details(args)
Arguments
  • args["rid"] : Ordr.in's unique restaurant identifier for the restaurant. (A number)

User Endpoints (API Reference)

Change Password (API Reference)

$ordrin_api->change_password(args)
Arguments
  • args["email"] : The user's email address
  • args["password"] : The user's new password (SHA256 hex encoded)
  • args["current_password"] : The user's current password

Create Account (API Reference)

$ordrin_api->create_account(args)
Arguments
  • args["email"] : The user's email address
  • args["pw"] : The user's password
  • args["first_name"] : The user's first name
  • args["last_name"] : The user's last name

Create Address (API Reference)

$ordrin_api->create_addr(args)
Arguments
  • args["email"] : The user's email address
  • args["nick"] : The nickname of this address
  • args["phone"] : The customer's phone number
  • args["zip"] : The zip code part of the address (5 digits)
  • args["addr"] : The street address
  • args["addr2"] : The second part of the street address, if needed
  • args["city"] : The city part of the address
  • args["state"] : The state part of the address (Two letters)
  • args["current_password"] : The user's current password

Create Credit Card (API Reference)

$ordrin_api->create_cc(args)
Arguments
  • args["email"] : The user's email address
  • args["nick"] : The nickname of this address
  • args["card_number"] : Credit card number (16 digits)
  • args["card_cvc"] : 3 or 4 digit security code (3 or 4 digits)
  • args["card_expiry"] : The credit card expiration date. (Two digits/Four digits)
  • args["bill_addr"] : The credit card's billing street address
  • args["bill_addr2"] : The second part of the credit card's biling street address.
  • args["bill_city"] : The credit card's billing city
  • args["bill_state"] : The credit card's billing state (2 letters)
  • args["bill_zip"] : The credit card's billing zip code (5 digits)
  • args["bill_phone"] : The credit card's billing phone number
  • args["current_password"] : The user's current password

Remove address (API Reference)

$ordrin_api->delete_addr(args)
Arguments
  • args["email"] : The user's email address
  • args["nick"] : The nickname of this address
  • args["current_password"] : The user's current password

Remove Credit Card (API Reference)

$ordrin_api->delete_cc(args)
Arguments
  • args["email"] : The user's email address
  • args["nick"] : The nickname of this address
  • args["current_password"] : The user's current password

Get Account Information (API Reference)

$ordrin_api->get_account_info(args)
Arguments
  • args["email"] : The user's email address
  • args["current_password"] : The user's current password

Get All Saved Addresses (API Reference)

$ordrin_api->get_all_saved_addrs(args)
Arguments
  • args["email"] : The user's email address
  • args["current_password"] : The user's current password

Get all saved credit cards (API Reference)

$ordrin_api->get_all_saved_ccs(args)
Arguments
  • args["email"] : The user's email address
  • args["current_password"] : The user's current password

Get an Order (API Reference)

$ordrin_api->get_order(args)
Arguments
  • args["email"] : The user's email address
  • args["oid"] : Ordr.in's unique order id number. (A number)
  • args["current_password"] : The user's current password

Get Order History (API Reference)

$ordrin_api->get_order_history(args)
Arguments
  • args["email"] : The user's email address
  • args["current_password"] : The user's current password

Get a single saved address (API Reference)

$ordrin_api->get_saved_addr(args)
Arguments
  • args["email"] : The user's email address
  • args["nick"] : The nickname of this address
  • args["current_password"] : The user's current password

Get a single saved credit card (API Reference)

$ordrin_api->get_saved_cc(args)
Arguments
  • args["email"] : The user's email address
  • args["nick"] : The nickname of this address
  • args["current_password"] : The user's current password
Something went wrong with that request. Please try again.