Constructor
Methods
country(country):Object
It is used to set country option in the OFF Instance
Parameters
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')
getBrand(brandName):Object
It is used to get all details of a specific brand
Parameters
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
})
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
})
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
})
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
})
getProduct(barcode):Object
It is used to get a specific product using barcode
Parameters
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
})
getProductsByBarcodeBeginning(beginning):Object
It is used to get all products beginning with the given barcode string
Parameters
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
})