Update Company API
Overview
Updates corporate client information, credit limits, or active status.
- Endpoint:
/api/companies/update - Method:
POST - Access: Super Admin / Platform RM
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | String (UUID) | Yes | Target company ID |
name | String | No | Updated display name |
creditLimit | Number | No | Updated credit limit |
creditDays | Number | No | Updated credit days |
active | Boolean | No | Enable/disable company access |
Request Body Example
{
"id": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"creditLimit": 1500000,
"creditDays": 45
}
Success Response (200 OK)
{
"success": true,
"message": "Company updated successfully",
"data": {
"id": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Abbott Healthcare",
"creditLimit": "1500000.00",
"creditDays": 45
}
}
Database Impact
- Table:
companies - Operations:
UPDATErecord by ID.