Trackstar API provides a sandbox environment for testing and development.

The sandbox environment is a copy of the production environment, but with mocked out data. You can use the sandbox to get familiar with the API and test your integrations, without affecting your production data.

1. Get an API key

You will need an API key to make API calls. See the Getting Started page for how to get one.

2. Set Up Your Sandbox

Use the API key to make a request to the generate-sandbox endpoint. This will set up the sandbox and return an access-token. See the sandbox endpoint for more details.

import requests

url = "https://production.trackstarhq.com/sandbox/generate-sandbox"
headers = {
 "x-trackstar-api-key": "YOUR_API_KEY",
}
response = requests.post(url, headers=headers)
response.raise_for_status()
response = response.json()

If successful, you should get a response like this:

{
  "access_token": "some_access_token",
  "integration_name": "sandbox",
  "connection_id": "<some_id>"
}

3. Make API calls

Now you can use the access token to make API calls to Trackstar’s sandbox!

import requests

url = "https://production.trackstarhq.com/wms/inventory"
headers = {
 "x-trackstar-api-key": "YOUR_API_KEY",
 "x-trackstar-access-token": "an_access_token" # from the prior step
}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()

You can read the API reference for all supported operations.

4. Frontend Sandbox

You can enable a “Sandbox” integration in the Trackstar UI modal by setting the sandbox prop in the Trackstar React Component. Clicking “Submit” will return an auth code that you can exchange for an access token.

This is useful for:

  1. Testing the end-to-end Trackstar integration flow without needing WMS credentials.
  2. Completing the link exchange generates sandbox data and returns an access token that you can use to make API calls to the sandbox. (Like in step 2 above)
Sandbox UI