Socket
Book a DemoInstallSign in
Socket

pizzapi

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pizzapi

API for Domino's pizza

Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
4
-50%
Maintainers
1
Weekly downloads
 
Created
Source

PizzaPI API

This is a node.js wrapper for the Domino's pizza API's

This work is licenced via the DBAD Public Licence. It is a derivative work from Dominos API.

Install PizzaPI

npm install pizzapi

Finding Nearby Domino's Locations

argumenttypedefaultrequired
addressfull or partial address stringnulltrue
callbackfunction to pass the api result tonulltrue
typeDelivery, Carryout, allallfalse

By Postal Code

this yields the least accurate information

pizzapi.Util.findNearbyStores(
    '63102',
    'Delivery',
    function(storeData){
        console.log(storeData);
    }
);

By City and Postal Code

this yields less accurate information but is better than just using the postal code

pizzapi.Util.findNearbyStores(
    'St. Louis, MO, 63102',
    'Delivery',
    function(storeData){
        console.log(storeData);
    }
);

Using Full or Nearly Full Address

this yields the best information and sorts stores by actual distance

pizzapi.Util.findNearbyStores(
    '700 Clark Ave, St. Louis, MO, 63102',
    'Delivery',
    function(storeData){
        console.log(storeData);
    }
);

Domino's Store Info

argumenttypedefaultrequired
storeIDstring or intnulltrue
callbackfunction to pass the api result tonulltrue
//Get Store Info for Store #4336
Store.getInfo(
    4336,
    function(storeData){
        console.log(storeData);
    }
);

Menu for Specific Domino's Store Location

argumenttypedefaultrequired
storeIDstring or intnulltrue
callbackfunction to pass the api result tonulltrue
langlanguage stringenfalse
//Get Menu for Store #4336
Store.getMenu(
    4336,
    function(storeData){
        console.log(storeData);
    }
);

Tracking Domino's Pizza

By Phone

argumenttypedefaultrequired
phonePhone number string or intnulltrue
callbackfunction to pass the api result tonulltrue
pizzapi.Track.byPhone(
    2024561111,
    function(pizzaData){
        console.log(pizzaData);
    }
);

By orderKey

argumenttypedefaultrequired
orderKeystring or intnulltrue
storeIDsting or intnulltrue
callbackfunction to pass the api result tonulltrue
pizzapi.Track.byId(
    123456,
    12345,
    function(pizzaData){
        console.log(pizzaData)
    }
);

Domino's Pizza Orders

Three classes exist to get orders started,

ClassDescription
dominos.class.Ordercreates a basic order object
dominos.class.Productcreates a basic product with a quantity of 1
dominos.class.Paymentcreates a basic credit card payment object

creating an order

var thePresident = new pizzapi.Customer({ firstName: 'Barack', lastName: 'Obama', address: '700 Pennsylvania Avenue, Washington, DC...', email: 'barack@whitehouse.gov' }); var order = new pizzapi.Order({ customer: thePresident, storeID: '4336' });

Adding a product to the order :

order.addItem(new pizzapi.Item({ code: '14SCREEN', options: {}, quantity: 1 }));

Validating an Order

This step is *Strongly recommended

order.validate(function(result) { console.log("We did it!"); });

Price an Order

order.price(function(result) { console.log("Price!") });

Place an Order

Order placing takes a Stripe token to minimize the amount of work you must do. This also helps to comply with PCI. At least one item must've been added to place an order.

order.place(stripeToken, function(result) { console.log("Order placed!"); })

Keywords

Dominos

FAQs

Package last updated on 04 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts