Get Specific Corporate
This GET endpoint retrieves details of a specific corporate record based on the provided corporate ID.
Endpoint
- URL:
/api/corporates/:id - Method:
GET
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Request Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be application/json. |
accessToken | string | Access token for authentication. (required) |
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
id | string | The unique ID of the corporate entity. | Yes |
Response
- Status Code: 200 OK
Success Response Body
{
"success": true,
"data": {
"id": "637e18fc741020de0693227a",
"parentCompany": "637e18fc741020de0693227b",
"name": "Axim Solutions",
"active": true,
"subCompanies": [
"637e18fc741020de0693227c",
"637e18fc741020de0693227d"
],
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-02-01T12:00:00Z"
}
}
Success Response Body Structure
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful. |
data | object | Contains details of the requested corporate. |
id | string | Unique identifier for the corporate entity. |
parentCompany | string | The ID of the parent company. |
name | string | The name of the corporate entity. |
active | boolean | Indicates if the corporate is active. |
subCompanies | array | List of associated sub-companies. |
createdAt | string | Timestamp of when the corporate was created. |
updatedAt | string | Timestamp of the last update to the corporate data. |
Error Responses
| Status Code | Description |
|---|---|
| 400 Bad Request | The provided corporate ID is invalid. |
| 401 Unauthorized | The access token is invalid or missing. |
| 404 Not Found | The corporate entity was not found. |
| 500 Internal Server Error | An error occurred on the server. |
Notes
- Ensure that the corporate ID is valid and exists in the system.
- Confirm that your access token is valid and has the necessary permissions to retrieve corporate data.
- This endpoint returns the corporate details if found; otherwise, it provides an appropriate error message.