Commerces
Get Commerce
Get a single commerce with its relations.
GET /api/commerces/:id
Returns a single commerce with its addresses, users, contacts, and roles.
Auth: Required — MANAGE_COMMERCES permission
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | Commerce ID |
Example
curl https://api.reten.ai/api/commerces/880e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>"import axios from 'axios';
const response = await axios.get(
'https://api.reten.ai/api/commerces/880e8400-e29b-41d4-a716-446655440000',
{
headers: {
Authorization: 'Bearer <token>',
'x-tenant-id': '<tenant-id>',
},
}
);
const commerce = response.data;Response 200 OK
{
"id": "880e8400-e29b-41d4-a716-446655440000",
"name": "Main Street Store",
"externalId": "store-001",
"taxId": "12345678-9",
"isActive": true,
"metadata": {},
"addresses": [
{
"id": "990e8400-e29b-41d4-a716-446655440000",
"street": "123 Main St",
"city": "Santiago",
"latitude": -33.4489,
"longitude": -70.6693,
"isPrimary": true,
"isActive": true
}
],
"users": [
{
"id": "aa0e8400-e29b-41d4-a716-446655440000",
"firstName": "Maria",
"lastName": "Garcia",
"isActive": true,
"roles": [{ "role": "OWNER" }],
"contacts": [
{
"id": "bb0e8400-e29b-41d4-a716-446655440000",
"type": "PHONE",
"value": "+56912345678",
"isPrimary": true,
"isActive": true
}
]
}
]
}Error Responses
| Status | Description |
|---|---|
404 | Commerce not found |