flipkart-affiliate
v1.1.0
Published
npm package for Flipkart Affiliate API
Downloads
20
Maintainers
Readme
flipkart-affiliate
npm package for Flipkart Affiliates API
Installation
Install using npm:
npm install flipkart-affiliate
Usage
Require library
var aff = require('flipkart-affiliate');
Create client
var fkc = aff.createClient({
FkAffId: 'affiliate_id', //as obtained from [Flipkart Affiliates API](https://affiliate.flipkart.com/api-docs/)
FkAffToken: 'affiliate_token',
responseType: 'json or xml'
});
Quick Examples
examples based on usage
Category Feed
fkc.getCategoryFeed({
trackingId: '*****'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
Product Feed
fkc.getProductsFeed({
url: 'as obtained from Category Feed'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
Search Query based on Keywords
fkc.keywordSearch({
query: "gumber", //search String
resultCount: "5" //no of products in result
}, function(err, results){
if(err){
console.log(err);
} else{
console.log(results);
}
});
Search Query based on Product
fkc.idSearch({
id: "PYJEGJJDZQ284MZS" //FSN Id
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
All Offers
fkc.getAllOffers(null,function(err, resp){
if(!err){
console.log(resp);
}else{
console.log(err);
}
});
Deals of the Day (DOTD) Offer
fkc.getDealsOfDay(null,function(err, resp){ //DOD
if(!err){
console.log(resp);
}else{
console.log(err);
}
});
Orders Report
fkc.getOrdersReport({
startDate: '2016-07-25',
endDate: '2016-08-04',
status: 'cancelled',
offset: '0'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
App Install Report
fkc.getAppInstReport({
startDate: '2016-07-25',
endDate: '2016-08-04',
status: 'approved'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});