un-official client for Flipkart Affiliates API
Install using npm:
npm install flipkart-affiliate-client
Require library
var affiliate = require('flipkart-affiliate-client');
Create client
var client = affiliate.createClient({
FkAffId: '(affiliate_id)',
FkAffToken: '(affiliate_token)',
responseType: '(json or xml)'
});
examples based on usage
client.getCategoryFeed({
trackingId: 'xxxxx'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
client.getProductsFeed({
url: '(url obtained from Category Feed)'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
client.keywordSearch({
query: "iphone",
resultCount: "1"
}, function(err, results){
if(err){
console.log(err);
} else{
console.log(results);
}
});
client.idSearch({
id: "MOBDPPZZPXVDJHSQ"
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
client.getAllOffers(null,function(err, resp){
if(!err){
console.log(resp);
}else{
console.log(err);
}
});
client.getDealsOfDay(null,function(err, resp){
if(!err){
console.log(resp);
}else{
console.log(err);
}
});
client.getOrdersReport({
startDate: '2015-10-22',
endDate: '2016-02-04',
status: 'cancelled',
offset: '0'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});
client.getAppInstReport({
startDate: '2015-10-22',
endDate: '2016-1-04',
status: 'approved'
}, function(err, result){
if(!err){
console.log(result);
}else {
console.log(err);
}
});