Skip to main content

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

HeaderTypeDescription
Content-TypestringMust be application/json.
accessTokenstringAccess token for authentication. (required)

Path Parameters

ParameterTypeDescriptionRequired
idstringThe 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

FieldTypeDescription
successbooleanIndicates if the request was successful.
dataobjectContains details of the requested corporate.
idstringUnique identifier for the corporate entity.
parentCompanystringThe ID of the parent company.
namestringThe name of the corporate entity.
activebooleanIndicates if the corporate is active.
subCompaniesarrayList of associated sub-companies.
createdAtstringTimestamp of when the corporate was created.
updatedAtstringTimestamp of the last update to the corporate data.

Error Responses

Status CodeDescription
400 Bad RequestThe provided corporate ID is invalid.
401 UnauthorizedThe access token is invalid or missing.
404 Not FoundThe corporate entity was not found.
500 Internal Server ErrorAn 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.