Get Company Group
The GET endpoint retrieves details of a specific company group identified by companyGroup_id.
Endpoint
- URL:
/companyGroup/{companyGroup_id} - Method:
GET
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
companyGroup_id | string | The unique identifier of the company group to retrieve. |
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Response
- Status Code: 200 OK
Sample Response Body
{
"success": true,
"data": {
"_id": "66a6dd927d6c18df2d9eb836",
"name": "BBC",
"company": [],
"priceList": "66ad153dbf8641f96544341d",
"status": true,
"createdAt": "2024-07-29T00:08:50.416Z",
"updatedAt": "2024-10-03T11:07:39.111Z",
"id": "66a6dd927d6c18df2d9eb836"
}
}
Success Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the success status of the request, typically true for a successful operation. |
data | object | Contains detailed information of the specified company group. |
Data Object:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the company group. |
name | string | The name of the company group. |
company | array | List of company IDs linked to this group. |
priceList | string | ID of the associated price list, if any. |
status | boolean | Active status of the company group. |
createdAt | string | Timestamp when the company group was created. |
updatedAt | string | Timestamp when the company group was last updated. |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 404 | Not Found: The specified company group could not be found. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Ensure you replace
{companyGroup_id}in the URL with the actual unique identifier of the company group being retrieved. - Provide a valid and active access token in the request header to authenticate your request.