Fynd Platform and Storefront APIs
website·Indexed 36 days ago
https://docs.fynd.com/Developer documentation for Fynd, featuring the Platform REST API for programmatic company management, the Storefront REST API for storefront customization, and the Storefront GraphQL API for flexible data querying.
What's inside Fynd
- The Application API (also known as the Storefront API) allows developers to customize online storefronts by providing access to the same data customers see during browsing. Key capabilities include retrieving product information (products, collections, variants), accessing customer orders, and managing the checkout process (adding items, applying discounts, and processing payments).
Overview of Fynd Platform REST API
The Platform API allows developers to programmatically manage a Fynd Platform company, providing access to the same data and operations available in the platform panel (e.g., managing products, inventory, and orders). The API operates at two levels:
- Company Level: Requires
company_id. Provides access to data across the entire company and all its applications (sales channels). - Application Level: Requires both
company_idandapplication_id. Provides access to data for a specific application within the company.
- Company Level: Requires
Understand Fynd Platform API scopes
The Platform API provides programmatic access to Fynd Platform company data. It operates at two distinct levels:
- Company Level: Requires the
company_idparameter. Provides access to data across the entire company and all its associated sales channels (applications). - Application Level: Requires both
company_idandapplication_idparameters. Provides access to data specific to a single application within the company.
- Company Level: Requires the
Install Fynd Storefront API client libraries
Official API client libraries are available for the following languages via GitHub Releases:Obtain an access token using client credentials
To get an access token for a specific company, make a POST request to the
/oauth/tokenendpoint.Authentication Requirement: The
Authorizationheader must contain a Base64 encoded string of{client_id}:{client_secret}passed as a Basic auth token.Constraint: Tokens obtained via this flow are limited to the single company associated with the credentials.
# 1. Generate the Base64 token string base64TokenString=$(echo -n {client_id}:{client_secret} | base64) # 2. Request the access token curl -X POST "https://api.fynd.com/service/panel/authentication/v1.0/company/{company_id}/oauth/token" \ -H "Authorization: Basic {base64TokenString}" \ -H 'Content-Type: application/json' \ -d '{"grant_type":"client_credentials"}'Obtain an access token using client credentials
To obtain an access token for a specific company, make a POST request to the
/oauth/tokenendpoint.Authentication Requirement: The
Authorizationheader must contain the stringBasic {base64TokenString}, where{base64TokenString}is the base64 encoded combination ofclient_id:client_secret.Constraint: Tokens obtained via this flow are limited to the single company associated with the credentials.
# Step 1: Convert client_id and client_secret to base64 base64TokenString=$(echo -n {client_id}:{client_secret} | base64) # Step 2: Request the access token curl -X POST "https://api.fynd.com/service/panel/authentication/v1.0/company/{company_id}/oauth/token" \ -H "Authorization: Basic {base64TokenString}" \ -H 'Content-Type: application/json' \ -d '{"grant_type":"client_credentials"}'Install Fynd Platform API client libraries
Official API client libraries are available for the following languages via GitHub Releases:Use the GraphQL Explorer for API testing
The GraphQL Explorer is an interactive tool for testing queries and mutations without writing code. It features:
- Interactive Query Building: Point-and-click interface to select fields.
- Schema Exploration: Browse types, fields, and documentation.
- Autocomplete: Intelligent suggestions while typing.
- Variables: A dedicated pane to define dynamic query variables.
- History: Ability to reuse previous requests.
Make authenticated requests to Platform APIs
Once you have retrieved anaccess_tokenvia the OAuth flow, include it in theAuthorizationheader of your API requests using theBearerscheme.curl -X GET "https://api.fynd.com/service/platform/configuration/v1.0/company/{company_id}/application" \ -H "Authorization: Bearer {access_token}"Retrieve application credentials from Fynd Platform
To authenticate requests, you need an
application_idandapplication_token. These are retrieved from the Fynd Platform panel:- Log in to the Fynd Platform.
- Select your company from the list to open the Dashboard.
- Navigate to the Developers tab in the sidebar to open the APIs & SDKs page.
- Click the Application Token tab to view the credentials for your specific application (sales channel).
Retrieve Client ID and Client Secret from Fynd Platform
To authenticate using client credentials, you must first generate them in the platform panel:
- Log in to the Fynd Platform account and select the target company.
- Navigate to the Developers tab in the sidebar to open the APIs & SDKs page.
- Click the Clients tab.
- Click Create Client, fill in the required details and permissions, and save.
- Copy the generated Client Id and Client Secret.
Authenticate requests to the Storefront GraphQL API
To authenticate requests, you must provide an
Authorizationheader. The value is a Bearer token consisting of theapplication_idandapplication_tokenjoined by a colon and encoded in base64.Steps to obtain credentials:
- Log in to the Fynd Platform.
- Select your company from the list.
- Navigate to the Developers tab in the sidebar $\rightarrow$ APIs & SDKs page.
- Click the Application Token tab to find the credentials for your specific sales channel.
# Generate the base64 token string base64TokenString=$(echo -n {application_id}:{application_token} | base64) # Use in the Authorization header # Authorization: Bearer <base64TokenString>