๐Ÿ“ Locations API: How to Use It

๐Ÿ” What is the Locations API?

The Locations API v1 allows you to retrieve the list of physical or organizational locations configured in your Clara account. Locations often represent cost centers, departments, office branches, or teams, and are used to organize users and expenses.

This API can be used to:

  • Display location options when assigning users or filtering data
  • Map transactions or cards to specific business units
  • Support reporting or internal structure alignment

๐Ÿ†š Note: This is a read-only version. To manage or create locations, use Locations API v2.


๐Ÿ“Œ Available Endpoints

OperationEndpointMethod
List all locations/v1/locationsGET
Get location by UUID/v1/locations/{uuid}GET

1๏ธโƒฃ Find all locations

Use this endpoint to retrieve the full list of locations configured in your organization. Each location includes metadata such as name, code, and status.

๐Ÿ”— Endpoint

GET /v1/locations

๐Ÿ“ค cURL Request

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

๐Ÿ“ฅ Sample JSON Response

[
  {
    "uuid": "loc-001",
    "name": "Headquarters - CDMX",
    "code": "CDMX-HQ",
    "status": "ACTIVE"
  },
  {
    "uuid": "loc-002",
    "name": "Warehouse - Monterrey",
    "code": "MTY-WHS",
    "status": "INACTIVE"
  }
]

2๏ธโƒฃ Find Location by UUID

Use this endpoint to get detailed information about a specific location using its unique identifier (uuid).

๐Ÿ”— Endpoint

GET /v1/locations/{uuid}

๐Ÿ“ค cURL Request

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

๐Ÿ“ฅ Sample JSON Response

{
  "uuid": "loc-001",
  "name": "Headquarters - CDMX",
  "code": "CDMX-HQ",
  "status": "ACTIVE"
}


๐Ÿ’ก Tip: Use the code field to link internal systems (e.g., ERP or HR) with Clara locations for consistency in reporting.

โš ๏ธ Note: This version of the API does not support creating or updating locations โ€” only retrieval is available.