Create Location

POST /locations

Create a new location

application/json

Body

  • Locations's ID generated from a third-party system such as a CRM, POS, or accounting software

  • name string
  • line_1 string Required

    Location's first required address

  • line_2 string
  • city string
  • region string
  • country string Required

    Country code in ISO-2 format

  • coordinates object Required
    Hide coordinates attributes Show coordinates attributes
    • lat number

      Minimum value is -90, maximum value is 90.

    • lng number

      Minimum value is -180, maximum value is 180.

  • zip_code string
  • abilities array[number]

    1 => Pickup,
    2 => Transfer,
    3 => Delivery,
    4 => Return

    Values are 1, 2, 3, or 4.

  • 1 => Scooter,
    2 => Car,
    3 => Van,
    4 => Small Truck,
    5 => Medium Truck,
    6 => Large Truck

    Values are 1, 2, 3, 4, 5, or 6.

Responses

  • 200

    OK

    Hide response attributes Show response attributes object
    • message string
    • data object
      Hide data attribute Show data attribute
      • location string(uuid)

        The locations's generated unique identifier

  • 201

    Created

POST /locations
curl \
 -X POST https://{workspace}.fleetrunnr.com/api/v1/locations \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"external_id":"12hhrr","name":"Main Warehouse","line_1":"2313 Retreat Avenue","line_2":"Ste 300","city":"Birmingham","region":"Alabama","country":"US","coordinates":{"lat":-90,"lng":-180},"directions":"","zip_code":"35203","abilities":[1],"allowed_vehicle_types":[2]}'
Request example
{
  "external_id": "12hhrr",
  "name": "Main Warehouse",
  "line_1": "2313 Retreat Avenue",
  "line_2": "Ste 300",
  "city": "Birmingham",
  "region": "Alabama",
  "country": "US",
  "coordinates": {
    "lat": -90,
    "lng": -180
  },
  "directions": "",
  "zip_code": "35203",
  "abilities": [
    1
  ],
  "allowed_vehicle_types": [
    2
  ]
}
Response examples (200)
{
  "message": "success",
  "data": {
    "location": "15f20760-76a7-41ee-b509-705d3ffd8eb5"
  }
}