Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dominos

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dominos

API for domino's Pizza

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
172
increased by132.43%
Maintainers
1
Weekly downloads
 
Created
Source

Node Domino's API

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

Install Domino's API

npm install dominos

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

dominos.store.find(
    '20500',
    function(storeData){
        console.log(storeData);
    }
);

By City and Postal Code

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

dominos.store.find(
    'Beverly Hills 90210',
    function(storeData){
        console.log(storeData);
    }
);

Using Full or Nearly Full Address

this yields the best information and sorts stores by actual distance

dominos.store.find(
    '1600 Pennsylvania Ave NW, 20500',
    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
dominos.store.info(
    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
dominos.store.menu(
    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
dominos.track.phone(
    2024561111,
    function(pizzaData){
        console.log(pizzaData);
    }
);

By orderKey

argumenttypedefaultrequired
orderKeystring or intnulltrue
storeIDsting or intnulltrue
callbackfunction to pass the api result tonulltrue
dominos.track.orderKey(
    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 order=new dominos.class.Order();
order.Order.Phone='2024561111';
order.Order.FirstName='Barack';
order.Order.LastName='Obama';
order.Order.Email='CommanderInChief@whitehouse.gov';

creating a product and adding it to the order :

var product=new dominos.class.Product();
product.Code='14SCREEN' //14" Hand Tossed Cheese Pizza
order.Order.Products.push(product);

Validating an Order

This step is *Strongly recommended

dominos.order.validate(
    order,
    function(data){
        console.log(data);
    }
);

Validating an Order

This step is *Strongly recommended

dominos.order.validate(
    order,
    function(data){
        console.log(data);
    }
);

Price an Order

dominos.order.price(
    order,
    function(data){
        console.log(data);
    }
);

Place an Order

Before you can place an order you must create a payment method and add it to the order :

paramatertyperequireddefault
AmountFloattrue0
NumberCredit Card Number Int/Stringtrue
CardTypeStringtrue
ExpirationDigits only Int/Stringtrue
SecurityCodeInt/Stringtrue
var cardInfo=new dominos.class.Payment();
cardInfo.Amount=42.50; 
//get amount from dominos.order.price request 
//data.result.Order.Amounts.Customer

cardInfo.Number='4444888888888888';
cardInfo.CardType='VISA';
cardInfo.Expiration='1017';
cardInfo.SecurityCode='189';
cardInfo.PostalCode='20500';

order.Order.Payments.push(cardInfo);

Then you can place the order and catch placement failures :

dominos.order.place(
    order,
    function(data){
        console.log(data);

        if(data.result.Order.Status==-1){
            console.log(
                '\n###### NO PIZZA FOR YOU! ######\n',
                orderData.result.Order.StatusItems,
                '\n#########################\n\n'
            );
            return;
        }

    }
);

Keywords

FAQs

Package last updated on 27 Oct 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc