🍕 EZ Pizza API 🍕
A simple library for interacting with the Dominos Pizza API.
Install
npm i ez-pizza-api
DOCS
See DOCS for all available methods and descriptions of each.
Example Usage
const ezPizzaAPI = ; async { const cityRegionOrPostalCode = 'Denver, CO, 80202'; const streetAddress = '1280 Grant St'; // Get a full list of stores near an address const storesResult = await ezPizzaAPI ; // Get basic info about nearest delivery store to address const storeResult = await ezPizzaAPI ; // Get full info about specified store const storeInfo = await ezPizzaAPI ; // Get full menu for the specified store const storeMenu = await ezPizzaAPI ; const couponId = '9193'; // Get info for the specified store and coupon // Coupon ID found in the above menu request const coupon = await ezPizzaAPI ; // Create an Order with the following properties const order = Order: Address: // <- Update this Street: '123 Sesame St.' City: 'New York' Region: 'NY' PostalCode: '10001' Type: 'House' StreetName: 'Sesame St' StreetNumber: '123' // Specify any coupons here, leave empty if not using a coupon Coupons: Code: couponId Qty: 1 ID: 2 // Specify your own IDs, increment if more than 1 specified Email: 'coolguy@gmail.com' // <- Update this FirstName: 'Cool' // <- Update this LastName: 'Guy' // <- Update this LanguageCode: 'en' OrderChannel: 'OLO' OrderMethod: 'Web' OrderTaker: null Payments: Phone: '1234567890' // <- Update this PhonePrefix: '1' // <- Update this // An array of products. Find the corresponding code and available options in the menu response. Products: Code: '12THIN' Qty: 1 isNew: true Options: X: '1/1': '1' C: '1/1': '1' Sa: '1/1': '1' J: '1/2': '1' Z: '2/2': '1' Code: 'MARBRWNE' Qty: 1 isNew: true Options: {} Code: 'B16PBIT' Options: {} Qty: 1 isNew: true ServiceMethod: ezPizzaAPIorderTypesDelivery // <- Update this can be Delivery or Carryout SourceOrganizationURI: 'order.dominos.com' StoreID: storeResultStoreID Tags: {} Version: '1.0' NoCombine: true Partners: {} OrderInfoCollection: ; const orderValid = await ezPizzaAPI; orderOrderOrderID = orderValidOrderOrderID; // get the generated orderID from the response const pricedOrder = await ezPizzaAPI; const Amount = pricedOrderOrderAmountsCustomer; // get total amount for order // specify the amount and credit card info OR see how to use cash on delivery below orderOrderPayments; // OR // specify the amount type as Cash orderOrderPayments; const placedOrder = await ezPizzaAPI; // For a succesful order, look for: // StoreOrderID // EmailHash // StatusItems: [ { Code: 'Success' } ] } // Be sure to check your email before trying again. // Sometimes this has a failure status but the order still goes through... console; // Getting the orderID may vary. Validate by looking at the placedOrder response const orderID = placedOrderOrderStoreOrderID1; // <- This might change depending on store const orderStatus = await ezPizzaAPI; console;};