API Overview

Foxtrot’s API can be accessed using the following URL format:

https://apiv1.foxtrotsystems.com/{ENDPOINT}

Authentication

Foxtrot’s API works with the API key provided during account setup. The API key has many privileges to access all data in the organization, so make sure it is kept secret! Do not share or store the API key online or expose it to the internet (places such as client-side code, GitHub, etc). Please keep this key in a secure location and avoid sending it over the internet unless connecting to Foxtrot’s servers over HTTPS.

Here’s an example call that will return distribution centers for an organization:

curl https://apiv1.foxtrotsystems.com/dcs \
    -X GET \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {{YOUR_API_KEY}}"

All API calls must include the Authorization header in order to access any information.

Request Structure

All API requests must have the following header values:

  • Content-Type must be set to application/json.
  • Authorization must be set to Bearer {{YOUR_API_KEY}}.

Response Structure

All API responses are formatted as follows:

{
  "status": "the status",
  "data": {
    "sample_key": "sample_value",
    "sample_key2": "sample_value2"
  }
}

The status key will contain one of these values:

  • success - The request has been successfully processed.
  • pending - The request has been accepted, but is still being processed.
  • error - An error occurred while processing the request. Please consult the individual endpoint documentation for more details. Both the HTTP status code the and data key will reveal more about what went wrong.

The data key contains relevant information about the request. Please consult the individual API endpoint documentation for more detail.

Sample success response

{
  "status": "success",
  "data": {
    "sample_key": "sample_value"
  }
}

Sample pending response

{
  "status": "pending",
  "data": {
    "sample_key": "sample_value"
  }
}

Sample error response

{
  "status": "error",
  "data": {
    "code": 1000,
    "message": "error message",
    "sample_key": "sample_value"
  }
}

The Foxtrot API doesn’t always return a code field within the error response, but if it does, please consult the Error Codes table to implement appropriate error handling for that error code. If the response does not have the code, please log the response. The API will try to return a useful error message for debugging.

Error Codes

Error Code Description
400 Bad parameters. Please check the documentation of the API to make sure you pass in all required arguments.
1000 Please contact us at support@foxtrot.io.
1001 User was not fully configured.
1002 DC was not fully configured.
2000 Driver with that id already exists.
2001 Driver with that id does not exist.
3000 There was an error with the supplied route. Please check the data.errors key for more details.
3001 The time windows are too restrictive. Please extend the window and try again.
3002 The stop cannot be at a warehouse.
3003 Route with that id does not exist.
3004 Cannot delete already analyzed routes.
3005 Cannot import another route with the same id.
3006 Cannot import another waypoint with the same id.
3007 Cannot import another delivery with the same id.
3008 Cannot import another invoice with the same id.
3009 Cannot import another invoice item with the same id.
5001 Route accounting record with that id already exists.