/api/v1/user/{id}
Retrieve a user belonging to the authenticated agent, including nested agent, sales partner, agent account (wallet/credit), broker point, and station.
Path parameters
| Name | Type | Description |
|---|---|---|
| id | integer | User ID |
Example request
GET /api/v1/user/62 X-API-KEY: your-agent-api-key-here
Example response (200)
{
"success": true,
"code": "US-S-0001",
"message": "User retrieved successfully",
"data": {
"id": 62,
"name": "Somchai Broker",
"email": "[email protected]",
"role": "agent",
"station_id": "uuid-station",
"agent_id": "01990f86-997d-714c-a471-4448ac3b9162",
"sales_partner_id": "uuid-sales-partner",
"agent": {
"id": "01990f86-997d-714c-a471-4448ac3b9162",
"name": "Demo Agent Co., Ltd.",
"code": "DEMO",
"type": "agent",
"site_url": "https://booking.example.com",
"isactive": "Y"
},
"sales_partner": {
"id": "uuid-sales-partner",
"name": "Island Broker",
"code": "BRK01",
"type": "broker",
"isactive": "Y",
"agent_id": "01990f86-997d-714c-a471-4448ac3b9162",
"agent_account": {
"id": "uuid-account",
"type": "broker",
"wallet_balance": 0,
"credit_balance": 15000,
"credit_limit": 100000
},
"broker_point": {
"id": "uuid-point",
"balance": 120
}
},
"station": {
"id": "uuid-station",
"name_en": "Phuket",
"name_th": "ภูเก็ต",
"nickname": "HKT"
}
}
}
Error (404)
{
"success": false,
"code": "US-E-1001",
"message": "User not found"
}