OFF


OFF

Class OFF Node API Wrappper of OFF API

Constructor

new OFF(options)

Create OFF object

Parameters
options:Object

Options for the OFF Object

options.country:string

Country for which you want to call OFF API Client

Source: main.js, line 8

Methods

country(country):Object

It is used to set country option in the OFF Instance

Parameters
country:string

Country value to set to the OFF Instance

Returns
Type
:Object

An OFF Instance with the country option set

Example
const worldOFF = new OFF()
const indiaOFF = worldOFF.country('in')
Source: main.js, line 36

getBrand(brandName):Object

It is used to get all details of a specific brand

Parameters
brandName:string

Brand name of the brand you want to fetch details

Returns
Type
:Object

It returns a JSON with all details of the brand

Example
const worldOFF = new OFF()
worldOFF.getBrand('monoprix').then(brand => {
  // use brand
})
Source: main.js, line 80

getBrands():Object

It is used to get all brands.

Returns
Type
:Object

It returns a JSON containing all brands

Example
const worldOFF = new OFF()
const indiaOFF = worldOFF.country('in')
indiaOFF.getBrands().then(brands => {
  // use brands
})
Source: main.js, line 50

getLabels():Object

It is used to get all Labels from the API

Returns
Type
:Object

It returns a JSON with all labels present on the API

Example
const worldOFF = new OFF()
worldOFF.getLabels().then(labels => {
  // use labels
})
Source: main.js, line 108

getLanguages():Object

It is used to get all languages on the labels

Returns
Type
:Object

It returns a JSON with list of all languages

Example
const worldOFF = new OFF()
worldOFF.getLanguages().then(languages => {
  // use languages
})
Source: main.js, line 94

getProduct(barcode):Object

It is used to get a specific product using barcode

Parameters
barcode:number

Barcode of the product you want to fetch details

Returns
Type
:Object

It returns a JSON of the product

Example
const worldOFF = new OFF()
worldOFF.getProduct(7622210288257).then(product => {
  // use product
})
Source: main.js, line 65

getProductsByBarcodeBeginning(beginning):Object

It is used to get all products beginning with the given barcode string

Parameters
beginning:string

Barcode string from which if the barcode begins, then product is to be fetched

Returns
Type
:Object

It returns a JSON of all products that begin with the given barcode string

Example
const worldOFF = new OFF()
worldOFF.getProductsByBarcodeBeginning('3596710').then(products => {
  // use products
})
Source: main.js, line 123

setOption():Object

It is used to set option in OFF instance

Returns
Type
:Object

An OFF Instance with option set

Source: main.js, line 22