Track API
Track's APIs enable you to integrate Track functionality into your own systems and sites. This section explains how to call Track's API endpoints.
Track environments
All URLs and examples in this Track documentation refer to the Live environment, also known as the Production environment. However, Track customers can also make use of the Sandbox environment for the initial testing of integrations and features that Track provides.
The Track live environment exists as a user interface at https://app.sorted.com/ and API requests use the base url of https://react-api.sorted.com/
.
Sandbox environment
The sandbox environment is the test environment where processes can be tested by your marketing and engineering team(s). This can range from the testing of initial integrations, the testing of tracking emails and notifications before implementing on your live environment.
You can log in to your sandbox account at https://app-sandbox.sorted.com/.
Sandbox base URL
If you want to test API requests on sandbox, make sure to use the base URL of https://react-api-sandbox.sorted.com/
instead of the live (production) base URL.
For example, to register a shipment in live, you would send a POST
request to https://react-api.sorted.com/react/shipments
.
To do so in sandbox, use the sandbox base URL of https://react-api-sandbox.sorted.com/react/shipments
.
More more information on the API requests you can make, visit our Track API reference.
Important
If you want to use sandbox to test API requests, make sure to grab the API key from the sandbox log in at https://app-sandbox.sorted.com/ and Get your API key.
API headers in Track
To call any of Track's APIs, you'll need an API key. You can create one from the Settings > API Keys tab in the Track UI.
Note
For more information on getting a Track API key, see the Setting up API keys section of the Settings page.
To use your API key, include it in an x-api-key
header when making an API call. We also recommend that you include JSON Content-Type
and Accept
headers too, as Track only works with JSON data.
Track endpoints
Track offers the following API endpoints:
Endpoint | Purpose |
---|---|
Register Shipments | Register shipments for tracking |
Get Shipment by Shipment ID | Retrieve shipment details by Track Shipment ID |
Get Shipments | Retrieve shipment details by tracking or custom reference |
Update Shipment | Update shipment details |
Delete Shipment | Delete a shipment |
Get Tracking Events by Shipment ID | Retrieve all shipment tracking events for a specified shipment |
Get Event | Retrieve events by Track Event ID |
Get Shipment Events | Retrieve events by date range, references and carrier |
Get Shipment Events by Shipment ID | Retrieve event details by Track Shipment ID |
Get Shipment States History | Retrieve a shipment's shipment state history |
API functions
- Registering Shipments - Explains how to use the Register Shipments endpoint and the SFTP bulk upload service to add shipments to Track.
- Retrieving Shipment and Event Data - Explains how to get data from the Shipment, Tracking, and Events APIs.
- Updating Shipments - Explains how to use the Update Shipment API to update and existing shipment's details.
- Error Codes - Explains the various error codes that Track can return.
- Calculated Events - Explains how Track calculates events, and how those events affect shipments.
Next steps
Read on for more info: