npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ordrin-api

v1.0.2

Published

A node library for the ordr.in food ordering API

Downloads

33

Readme

Ordr.in Node Library

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

Table of Contents

Installation

This library can be installed with npm:

npm install ordrin-api

Usage

Callbacks

Because node is async, every function call you make to the ordrin api includes a callback. This callback will be called when the API has finished processing the request. This callback takes two arguments, error and data. If the request fails, then error will be an Error object; otherwise it will be falsy. The data argument contains the JavaScript object returned by the API.

Initialization

var ordrin = require("ordrin-api");
// Initialize with your application secret key
var ordrin_api = new  ordrin.APIs(api_secret_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_api.order_guest(args, callback)
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, callback)
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.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)
Or
  • args.nick : The delivery location nickname. (From the user's addresses)
Either
  • 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
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
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, callback)
Arguments
  • args.email : The user's email address
  • args.nick : The nickname of this address
  • args.current_password : The user's current password