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',
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",
resultCount: "5"
}, function(err, results){
if(err){
console.log(err);
} else{
console.log(results);
}
});
Search Query based on Product
fkc.idSearch({
id: "PYJEGJJDZQ284MZS"
}, 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){
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);
}
});