Reflaunt SDK
Installation
NPM
npm install @reflaunt/reflaunt-sdk
Yarn
yarn add @reflaunt/reflaunt-sdk
Usage
Create new instance of Reflaunt
import Reflaunt from '@reflaunt/nodejs-sdk';
const reflaunt = new Reflaunt(YOUR_CLIENT_ID, YOUR_CLIENT_SECRET);
Category
Retreive all category
const categories = await reflaunt.category.all();
Get category information
const category = await reflaunt.category.show(CATEGORY_ID);
Product
Retreive list of product
const products = await reflaunt.product.get(PARAMS);
Available params
- page
int
- per_page
int
Example
const product = await reflaunt.product.get({ page: 1, per_page: 20 });
Get product information
const product = await reflaunt.product.show(PRODUCT_ID);
Create new product
const product = await reflaunt.product.create(PRODUCT_ATTRIBUTES);
Example
const product = await instance.product.create({
name: 'PRODUCT_NAME',
description: 'PRODUCT_DESCRIPTION',
images: ['PRODUCT_IMAGE_URL'],
original_price: 'ORIGINAL_PRICE',
website: 'RETAILER_WEBISTE',
price: 'PRICE',
customer_email: 'CUSTOMER_EMAIL',
category_id: 'CATEGORY_ID'
});
Delete a product
const product = await reflaunt.product.delete(PRODUCT_ID);