Skip to main content

Get All Company Groups

Retrieves a paginated list of all company groups.

HTTP Request​

  • URL: /companyGroup/all
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_COMPANYGROUP or READ_WRITE_COMPANYGROUP

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of groups per page. Default is 10.

cURL Example​

curl --location '<BASE_URL>/companyGroup/all?page=1&limit=20' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The company groups were returned successfully.
  • 400 Bad Request: The access token is missing or invalid.

Sample JSON Response​

{
"success": true,
"data": [
{
"_id": "66a6dd927d6c18df2d9eb836",
"id": "66a6dd927d6c18df2d9eb836",
"name": "Wholesale",
"company": [],
"priceList": "66ad153dbf8641f96544341d",
"status": true,
"taxZones": [],
"paymentAccess": { "mode": "inherit", "methods": [] },
"createdAt": "2024-07-29T00:08:50.416Z",
"updatedAt": "2024-10-03T11:07:39.111Z"
},
{
"_id": "66c823f1d484025cfe9bcd52",
"id": "66c823f1d484025cfe9bcd52",
"name": "Contractors",
"company": [],
"priceList": null,
"productGroups": {
"groups": [
{
"productGroup": "66cda944ee801563b8eec563",
"type": "exclude"
}
],
"restrictStoreProductVisibility": false
},
"status": true,
"taxZones": [],
"createdAt": "2024-08-23T05:53:53.984Z",
"updatedAt": "2024-08-31T18:18:04.335Z"
}
],
"pagination": {
"page": 1,
"total": 2,
"count": 2
}
}

Response Details​

Company Group Data​

Each item in data has the same fields as the company group returned by Get Company Group.

Pagination Details​

FieldTypeDescription
pageNumberCurrent page number.
totalNumberTotal number of company groups.
countNumberNumber of company groups on this page.