๐Ÿ“ Locations API: How to Use It

๐Ÿ” What is the Locations API?

The Locations API (v2) allows you to retrieve information about your organization's locations (also known as cost centers or office sites). These locations can later be associated with users, transactions, cards, and policies.

This API is typically used to:

  • Fetch a list of all available locations in your company
  • Get detailed data for a specific location by UUID
  • Integrate location metadata into internal tools or reporting systems

๐Ÿ“Œ Available Endpoints

OperationEndpointMethod
Retrieve all locations/v2/locationsGET
Get location by UUID/v2/locations/{uuid}GET

1๏ธโƒฃ Retrieve all locations

Get a complete list of all locations associated with your company.

๐Ÿ”— Endpoint

GET /v2/locations

๐Ÿ“ค cURL Request

curl -X GET \
"https://public-api.mx.clara.com/api/v2/locations" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

๐Ÿ“ฅ Sample JSON Response

[
  {
    "uuid": "e8b5b764-f8d9-42d0-861a-f13aa2312734",
    "name": "Headquarters - CDMX",
    "code": "CDMX-HQ",
    "status": "ACTIVE"
  },
  {
    "uuid": "a2a8b29f-3c84-4d58-bcb1-b2dc3b23cf01",
    "name": "Warehouse - GDL",
    "code": "GDL-WHS",
    "status": "ACTIVE"
  }
]


2๏ธโƒฃ Retrieve Location by UUID

Fetch detailed information about a specific location using its UUID.

๐Ÿ”— Endpoint

GET /v2/locations/{uuid}

๐Ÿ“ค cURL Request

curl -X GET \
"https://public-api.mx.clara.com/api/v2/locations/e8b5b764-f8d9-42d0-861a-f13aa2312734" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

๐Ÿ“ฅ Sample JSON Response

{
  "uuid": "e8b5b764-f8d9-42d0-861a-f13aa2312734",
  "name": "Headquarters - CDMX",
  "code": "CDMX-HQ",
  "status": "ACTIVE",
  "createdAt": "2023-10-15T10:30:00Z"
}


๐Ÿ’ก Tip: Location UUIDs can be used when creating users, cards, or setting approval policies to associate activity with a specific office or department.

โš ๏ธ Note: Locations marked as INACTIVE are still returned, but should not be assigned to new resources.