Skip to content

Node js module for using Jumbo (Dutch store) api

Notifications You must be signed in to change notification settings

niekh1234/jumbo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Node js module for using Jumbo (Dutch store) api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published