Customers API

Summary

Resource Operation Description
  GET /dcs/(dc_id)/customers/(customer_id)/waypoints Get waypoint information for a given customer id`
Customers GET /dcs/(dc_id)/customers/(customer_id)/confident-location Get the confident location for a customer if available
  GET /dcs/(dc_id)/customers/(customer_id) Get a customer

Details

GET /dcs/(dc_id)/customers/(customer_id)/confident-location
Parameters:
  • dc_id (string) – The dc id
  • customer_id (string) – The customer’s id
Status Codes:
Error Code Description
7001 Customer location not confident.

Example request

{
  "dc_id": "Foxtrot-DC",
  "customer_id": "johns-burger-shack"
}

Example response

{
  "status": "success",
  "data": {
    "customer_id: "johns-burger-shack",
    "latitude": 1.00456,
    "longitude": -3.123534
  }
}
GET /dcs/(dc_id)/customers/(customer_id)/waypoints
Parameters:
  • dc_id (string) – The dc id
  • customer_id (string) – The customer’s id
Status Codes:

Example response

{
  "waypoints": [
    {
      "id": "The waypoint's id",
      "customer_id": "The customer's id",
      "status": "PENDING",
      "completed_timestamp": null,
      "estimated_time_of_arrival": 123456,
      "waypoints_ahead": 4,
      "waiting_time_seconds": 600,
      "route_id": "The route's id"
    },
    ...
  ]
}

Note that this only returns the most recent 10 waypoints for the customer.

GET /dcs/(dc_id)/customers/(customer_id)
Parameters:
  • dc_id (string) – The dc id
  • customer_id (string) – The customer’s id
Status Codes:

Example response

{
  "status": "success",
  "data": {
    "customer": {
      "id": "the customer's id",
      "name": "the customer's name",
      "imported_address": "address string",
      "imported_location": {
        "latitude": 37.77493,
        "longitude": 122.41942
      },
      "inferred_location": {
        "latitude": 37.77483,
        "longitude": 122.41940
      }
    }
  }
}

Note that the location object may be null if Foxtrot does not have an imported location for the customer.