Flipkart Marketplace Seller APIs

The FMSAPIs allow a seller’s applications to programmatically access and exchange data with the Flipkart Marketplace. They automate all business processes associated with selling on the Marketplace. A seller can use these APIs to search orders, print shipping labels and invoices, and manage orders at different stages of the order lifecycle.

Seller Registration

To start working with seller APIs, first register as a seller with the Marketplace at https://seller.flipkart.com.

Note

  • The username and password provided during the registration process does not provide API access
  • You need seller IDs and corresponding access tokens for both the sandbox and production environments

Third-Party Application Integration

As a registered seller you can log into the Seller APIs - Developer Admin portal, in the staging and production environments both, to register third-party applications that can call APIs.

Important

  • Testing the application integration in the staged setup (sandbox) is prerequisite to implementing it in a live (production) setup. Both setups use the OAuth framework.
  • All seller APIs must be HTTPS requests. HTTP requests are invalid.
  • Do not set the access token value in the authorization headers as the token expires after some time - usually, 60days.

Sandbox Environment

The sandbox is a staging setup where you can design, program, and test applications in a controlled environment before implementing them in the production environment. Products listed in this environment are not real; however, changing the base URL to that of the production environment enable the applications to go live with real products and users.

Production Environment

The production environment is the live Flipkart platform. Products listed in this environment are available to real Flipkart users. The information provided for this environment are governed by the Flipkart Marketplace terms of usage (TOU).

Authentication Process

Once your application is registered, you need to generate an access token to be able to call the APIs. All OAuth flows are supported by the Flipkart framework however, this document covers the Client Credentials and Authorization Code flows only.

To authenticate using the OAuth framework:

  1. Log into the Seller APIs - Developer Admin portal.

  2. Click Register new application.

  3. Provide the following configuration data:

    • Application Name: The name of your third-party application
    • Application Description: Relevant description for your application
    • Application Type: Pre-populated based on the chosen OAuth flow
    • Scope: Pre-populated with the specific Seller API
  4. Click Register application. The new application is now added to your applications list and a unique Application ID (<appid>) and Application Secret (<app-secret>) pair is assigned.

  5. Generate the access token.

    • Client Credentials Flow - used when the application accesses API resources that it owns.

      ☰ SHOW | HIDE

      1. Call the authentication API. You can write code in any language to make a REST call or use curl to get the access tokens. You can pass multiple scopes as comma separated values. If no scope is specified, all possible scopes are registered with the Application ID.

        oauth/token?grant_type=client_credentials&scope=Seller_Api,Default
        
      2. Set your Application ID and Application Secret in the header.

        Sample header for sandbox

        curl -u <appid>:<app-secret> https://sandbox-api.flipkart.net/oauth-service/oauth/token\?grant_type\=client_credentials\&scope=Seller_Api
        

        Sample header for production

        curl -u <appid>:<app-secret> https://api.flipkart.net/oauth-service/oauth/token\?grant_type\=client_credentials\&scope=Seller_Api
        

        Sample response

        {"access_token":"<token>","token_type":"bearer","expires_in":3330779,"scope":Seller_Api"}
        

  • Authorization Code Flow - used when an application is registered to access APIs on another user’s behalf.

    ☰ SHOW | HIDE

    1. Get a temporary authorization code (redirected to the Flipkart OAuth page) by passing the client_id, redirect_uri, scope, and state variable.

      Sample URL for sandbox

      https://sandbox-api.flipkart.net/oauth-service/oauth/authorize?client_id=24a22714a4c418012931ba583b54030648a9&redirect_uri=http://www.bing.com/&response_type=code&scope=Seller_Api&state=1233
      

      Sample URL for production

      https://api.flipkart.net/oauth-service/oauth/authorize?client_id=36a17224a4b418012931aa583b37540048a9&redirect_uri=http://www.bing.com/&response_type=code&scope=Seller_Api&state=1234
      
    2. Use your seller login credentials to login to the Flipkart Permission Registration page that appears.

    3. Click Allow in the Request for Authorization dialog. The application redirects to the URI (redirect_uri) passing the authorization code and state variable. This code is short-lived and must be exchanged for a token.

      Sample header for sandbox

      curl ­u 24a22714a4c418012931ba583b54030648a9:87c2c82640283de9cbaf0f1ee39e7ef9dhttps://sandbox-api.flipkart.net/oauth-service/oauth/token\?redirect_uri\=http://www.bing.com/\&grant_type\=authorization_code\&state\=1233\&code\=lGi0D9
      

      Sample header for production

      curl ­u 36a17224a4b418012931aa583b37540048a9:38b2a79736908ca9cbae9f1ed64e7fa3dhttps://api.flipkart.net/oauth-service/oauth/token\?redirect_uri\=http://www.bing.com/\&grant_type\=authorization_code\&state\=1234\&code\=lGi0D9
      

      Sample response

      {"access_token":"f638949a­c979­4172­b33c­23311a168647","token_type":"bearer","refresh_token":"860e03da­d58a­4988­9149-a4a7f365bba1","expires_in":5183999,"scope":"DefaultSeller_Api"}%
      

Making API Calls

Use the access token (<token>) displayed in the authorization header to send subsequent requests.

Sample Search API Call

The following sample header calls the Search Order API in the production environment on providing a valid <token> value. You can change the URL to https://api.flipkart.net/sellers/orders/search to call the API in production.

curl -H"Authorization:Bearer <token>"-H"Content-Type: application/json" -d '{"filter" :{}}'https://sandbox-api.flipkart.net/sellers/orders/search