Getting Started with fabric APIs - Fabric

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

This topic will provide instructions to start using fabric’s APIs to build unique and flexible shopping experiences for your customers. fabric recommends Postman as the API client.

API URL

The base URL, which is also called fabric-base-url, https://api.fabric.inc/v3/{product} is the standard URL to which the requests are sent for all fabric APIs.

Prerequisites

Before you can start using fabric’s APIs:

Procedure

  1. Log in to your Copilot account.
  2. In the left menu, click Settings > Developer Tools.
  3. Click API Apps.
  1. Click the name of a system app that’s already created for your account.

The details of the system app are displayed. 5. Make a note of the following settings:

These values are required for authentication of your system app and to start using the APIs. For more information about these settings, see the API Apps page. 6. In the following code sample for the /token endpoint, replace the {{authURL}}, {{clientId}}, and {{clientSecret}} with the corresponding values from step 5:

curl --location --request POST '{{authURL}}/v1/token'
--header 'accept: application/json'
--header 'cache-control: no-cache'
--header 'content-type: application/x-www-form-urlencoded'
--data-urlencode 'grant_type=client_credentials'
--data-urlencode 'scope=s2s'
--data-urlencode 'client_id={{clientId}}'
--data-urlencode 'client_secret={{clientSecret}}'
  1. Log in to the Postman client.

  2. To generate an access token, do the following steps:

  3. In the left menu, click Import.

  4. Import the code sample from Step 6.

  5. Run the /token endpoint.

{
      "token_type": "Bearer",
      "expires_in": 600,
      "access_token": "eyJraWQiOiIt...",
      "scope": "s2s"
}
  1. Make a note of the access token.

The access token is used to authenticate all your API requests. The token expires after 10 minutes. You must generate a new access token to continue using the API endpoints. 4. Make your first API request.

Related resources