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
| address | full or partial address string | null | true |
| callback | function to pass the api result to | null | true |
| type | Delivery, Carryout, all | all | false |
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
| storeID | string or int | null | true |
| callback | function to pass the api result to | null | true |
//Get Store Info for Store #4336
Store.getInfo(
4336,
function(storeData){
console.log(storeData);
}
);
| storeID | string or int | null | true |
| callback | function to pass the api result to | null | true |
| lang | language string | en | false |
//Get Menu for Store #4336
Store.getMenu(
4336,
function(storeData){
console.log(storeData);
}
);
Tracking Domino's Pizza
By Phone
| phone | Phone number string or int | null | true |
| callback | function to pass the api result to | null | true |
pizzapi.Track.byPhone(
2024561111,
function(pizzaData){
console.log(pizzaData);
}
);
By orderKey
| orderKey | string or int | null | true |
| storeID | sting or int | null | true |
| callback | function to pass the api result to | null | true |
pizzapi.Track.byId(
123456,
12345,
function(pizzaData){
console.log(pizzaData)
}
);
Domino's Pizza Orders
Three classes exist to get orders started,
| dominos.class.Order | creates a basic order object |
| dominos.class.Product | creates a basic product with a quantity of 1 |
| dominos.class.Payment | creates 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!");
})