1.0.1 • Published 4 years ago
ekshop-ep-nodejs-package v1.0.1
Ekshop Ecommerce Partner Integration
Installation
Use the package manager to install the package.
npm i ekshop-ep-nodejs-package
Usage
const ekep = require('ekshop-ep-nodejs-package');
//Call inside your function for get access token
ekep.getAccessToken({login_id: 'support@amarbazar.shop'}).then(function (_response) {
console.log(_response);
});
//Fetch your required product and map similar to
ekep.uploadProduct(req.body.accessToken, data).then(function (_response) {
console.log(_response);
});
product_reference_id : this is your product ID
category : Your product category name
Structure of Data
data = [
{
"product_reference_id": 1,
"name": "Product 1",
"category": "Partner product",
"brand": "partner brand",
"model": "",
"keywords": ["Mobile", "Phone", "Turing", "AI Phone"],
"highlights": "Highlights or short and important information about the product.",
"product_description": "Product full description with image and video.",
"video_url": "https://www.youtube.com/watch?v=h7C6yGgWVX4",
"images": [
{
"actual_img": "https://picsum.photos/480",
"mid_img": "https://picsum.photos/480",
"thumb_img": "https://picsum.photos/480"
}
],
"sku_type": 1,
"attributes": [{"attribute_name": "Color", "data": [{"val": "Black"}, {"val": "Blue"}, {"val": "White"}]}, {"attribute_name": "Memory", "data": [{"val": "4GB"}, {"val": "6GB"}, {"val": "8GB"}]}],
"sku_information": [
{
"is_enabled": true,
"is_default": true,
"attr_combo": ["Black", "4GB"],
"sku": "SKU-12549",
"quantity": 10,
"price": 12499.99,
"special_price": 12499.99,
"images": [
{
"actual_img": "https://picsum.photos/480",
"mid_img": "https://picsum.photos/480",
"thumb_img": "https://picsum.photos/480"
},
{
"actual_img": "https://picsum.photos/480",
"mid_img": "https://picsum.photos/480",
"thumb_img": "https://picsum.photos/480"
}
]
},
{"is_enabled": true, "is_default": false, "attr_combo": ["Black", "6GB"], "sku": "SKU-12549", "quantity": 5, "price": 15999.99, "special_price": 15000}
],
"faq": [
{"question": "Question 1", "answer": "Answer for 1"},
{"question": "Question 2", "answer": "Answer for 2"},
{"question": "Question 3", "answer": "Answer for 3"}
]
},
{
"product_reference_id": 2,
"name": "product 2",
"category": "partner new category",
"brand": "partner brand",
"model": "",
"keywords": ["Mobile", "Phone", "Turing", "AI Phone"],
"highlights": "Highlights or short and important information about the product.",
"product_description": "Product full description with image and video.",
"video_url": "https://www.youtube.com/watch?v=h7C6yGgWVX4",
"images": [
{
"actual_img": "https://picsum.photos/480",
"mid_img": "https://picsum.photos/480",
"thumb_img": "https://picsum.photos/480"
}
],
"sku_type": 1,
"attributes": [{"attribute_name": "Color", "data": [{"val": "Black"}, {"val": "Blue"}, {"val": "White"}]}, {"attribute_name": "Memory", "data": [{"val": "4GB"}, {"val": "6GB"}, {"val": "8GB"}]}],
"sku_information": [
{
"is_enabled": true,
"is_default": true,
"attr_combo": ["Black", "4GB"],
"sku": "SKU-12549",
"quantity": 10,
"price": 12499.99,
"special_price": 12499.99,
"images": [
{
"actual_img": "https://picsum.photos/480",
"mid_img": "https://picsum.photos/480",
"thumb_img": "https://picsum.photos/480"
},
{
"actual_img": "https://picsum.photos/480",
"mid_img": "https://picsum.photos/480",
"thumb_img": "https://picsum.photos/480"
}
]
},
{"is_enabled": true, "is_default": false, "attr_combo": ["Black", "6GB"], "sku": "SKU-12549", "quantity": 5, "price": 14857.99, "special_price": 14000.00}
],
"faq": [
{"question": "Question 1", "answer": "Answer for 1"},
{"question": "Question 2", "answer": "Answer for 2"},
{"question": "Question 3", "answer": "Answer for 3"}
]
},
{
"product_reference_id": 3,
"name": "product 3",
"category": "partner new category",
"brand": "partner brand",
"model": "",
"keywords": ["Mobile", "Phone", "Turing", "AI Phone"],
"highlights": "Highlights or short and important information about the product.",
"product_description": "Product full description with image and video.",
"video_url": "https://www.youtube.com/watch?v=h7C6yGgWVX4",
"images": [
{
"actual_img": "https://picsum.photos/480",
"mid_img": "https://picsum.photos/480",
"thumb_img": "https://picsum.photos/480"
}
],
"sku_type": 2,
"attributes": null,
"sku_information": [
{"is_enabled": true, "is_default": false, "attr_combo": null, "sku": "SKU-12549", "quantity": 5, "price": 14857.99, "special_price": 14000.00}
],
"faq": null
}
];