๐ 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
Operation | Endpoint | Method |
---|---|---|
Retrieve all locations | /v2/locations | GET |
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.