Platform REST API

Introduction

The Platform API allows developers to manage a Fynd Commerce company programmatically, providing access to the same data and operations available to sellers. Key features include managing products, tracking and updating inventory across locations, viewing and fulfilling orders, and more.
There are two variants of the Platform API, based on the granularity of data access:

  1. Company Level: Requires the company_id parameter and provides access to data across the entire company, including all its applications (sales channels). Example: listCategories API fetches a list of applications within a company.
  2. Application Level: Requires both company_id and application_id parameters and provides access to data for a specific application within the company. Example: getAppProducts API retrieves all products associated with an application.

We recommend using the SDK methods for accessing our APIs. You can find these methods in the code block next to each API under the platformClient object. Click here to learn more about how to access the platformClient.

Download the Postman collection


Client Libraries

Use our official API client libraries to easily interact with our APIs in the programming language of your choice

javascript
Javascript
java
Java
kotlin
Kotlin
swift
Swift

Authentication

To interact with the Platform APIs, you'll need a valid access-token. Depending upon your use case, you can obtain an access-token in the following ways:

  1. To develop an extension: You need to implement OAuth in order to get access-token for the companies that install your extension. Refer to this guide on implementing OAuth in extension.
  2. To integrate a company on the Fynd Commerce with external systems: You can generate an access-token for the required company using the client credentials of that company. Refer to Getting Access-token using Client Credentials for the steps.

Getting Access-token using Client Credentials

Prerequisites

  • Ensure that you have registered on the Fynd Commerce and have access to the company.

Collect Client Credentials

You can obtain your client credentials from Fynd Commerce. Follow the steps below to retrieve the credentials from a company:

  1. Log in to your Fynd Commerce account.
  2. If you have access to multiple companies, you will get the option to select a company.
  3. Select the company from the list andit will open the Fynd Commerce page.
  4. In the sidebar, navigate to Company SettingsDevelopers tab and click Clients.
      - If no client credentials are available, click Create Client and fill in the required details. You will get a success notification when client's credentials are created.

Generate Access-token using Client Credentials

To make a Platform API call, you will need a valid access-token. Access-tokens are generated using your client credentials. To obtain an access-token, you should construct a POST request to the /oauth/token endpoint. Please include the parameters specified below in the request body:

Note: An access-token is limited to accessing data from a single company associated with the credentials used to generate it.
  1. Run the following command to convert client credentials to base64TokenString:
    1base64TokenString=$(echo -n <client_id>:<client_secret> | base64)
  2. Run the following command to view the base64TokenString and save it for later use:
    1echo $base64TokenString
  3. Use the following cURL to generate the access-token:
    1curl -X POST "https://api.fynd.com/service/panel/authentication/v1.0/company/{company_id}/oauth/token" \
    2-H "Authorization: Basic <base64TokenString>" \
    3-H 'Content-Type: application/json' \
    4-d '{"grant_type":"client_credentials"}'
    • grant_type: Pass it as client_credentials to get access-token.
    Response

    Upon a successful request, the server will respond with an access-token as shown below:

    1{
    2 "access_token": oa-12345fb123456b2ce111f43cdb55fd317def1234,
    3 "token_type": "Bearer",
    4 "expires_in": 3599,
    5 "expires_at": 1759834568.805,
    6 "scope": ["company/*", "company/application/*"]
    7}
  4. To make authenticated requests to Platform APIs, pass the access-token (received in response) in the authorization header:
    1Authorization: Bearer <access_token>

Example

In the below given example, we can retrieve a list of products available in a company using the getProducts API. You need to pass the company ID and authorization token to make the API call.

1curl -X GET "https://api.fynd.com/service/platform/catalog/v2.0/company/{company_id}/products/" \
2-H 'Authorization: Bearer {access_token}'