1.1.5 • Published 3 years ago

jumbo-api v1.1.5

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

Welcome to the unofficial jumbo.com api wrapper for NodeJS

This package is still WIP

Installation

npm i jumbo-api
const JumboApi = require('jumbo-api');

Example Usage

Getting a product:

Returns a promise.

JumboApi.getProduct('67649PAK') //getting product information for milk
   .then((products) => {
      console.log(products);
   })
   .catch((err) => {
      console.log(err);
   })

Example output:

{ id: '67649PAK',
  title: 'Jumbo Verse Halfvolle Melk 2L',
  quantityOptions:
   [ { defaultAmount: 1,
       minimumAmount: 1,
       amountStep: 1,
       unit: 'pieces',
       maximumAmount: 99 } ],
  prices:
   { price: { currency: 'EUR', amount: 165 },
     unitPrice: { unit: 'l', price: [Object] } },
  available: true,
  productType: 'Product',
  crossSellSKUList: [],
  quantity: '2000 ml',
  ... etc
 }

The rest

All wrapper functions follow the same format, all return a promise:

JumboApi.method('')
   .then((res) => {})
   .catch((err) => {});

For an easy read, I will just provide all possible methods and not write the format above.

Search products

JumboApi.searchProducts(query, limit, offset)

Search by product id

JumboApi.searchId(productId)

Get all stores

JumboApi.getStores()

Get individual store

JumboApi.getStore(storeId)

Get unoccupied delivery timeslots for store

JumboApi.getStoreDeliveryTimeSlots(storeId)

Get unoccupied pickup timeslots for store

JumboApi.getStorePickupTimeSlots(storeId)

Get current promotions for shop

JumboApi.getStorePromotions(storeId)

Auth

Login and get a token for protected api calls

JumboApi.getToken(username, password)
   .then((token) => {
      // save token for later. Or do something cool.
      // keep in mind that due to everything being async, having another function using the token *below* this function will not work
   })
   .catch((err) => {
      console.log(err)
   })

Get your orders:

JumboApi.getMyOrders(token)
   .then((orders) => {})
   .catch((err) => {})

This package is still a work in progress, if you would like to help you are free to submit a pr! Check it out on Github

1.1.5

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago