Skip to main content

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

ParameterTypeDescription
companyGroup_idstringThe unique identifier of the company group to retrieve.

Request Headers

HeaderTypeDescription
accessTokenstringAccess 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

FieldTypeDescription
successbooleanIndicates the success status of the request, typically true for a successful operation.
dataobjectContains detailed information of the specified company group.

Data Object:

FieldTypeDescription
idstringUnique identifier of the company group.
namestringThe name of the company group.
companyarrayList of company IDs linked to this group.
priceListstringID of the associated price list, if any.
statusbooleanActive status of the company group.
createdAtstringTimestamp when the company group was created.
updatedAtstringTimestamp when the company group was last updated.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
404Not Found: The specified company group could not be found.
500Internal 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.