Wondering what’s next for npm?Check out our public roadmap! »

    flipkart-affiliate

    1.1.0 • Public • Published

    flipkart-affiliate

    NPM

    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);
        }
    });

    Install

    npm i flipkart-affiliate

    DownloadsWeekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • avatar