Skip to main content

Get All Product Groups

Retrieves all product groups, one page at a time. Each group includes its product count and a page of its products.

HTTP Request​

  • URL: /productGroup/all
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_PRODUCTGROUP or READ_WRITE_PRODUCTGROUP

Query Parameters​

ParameterTypeDescription
pageIntegerPage of product groups to return. Default is 1.
limitIntegerNumber of product groups per page. Default is 10.
searchStringFilter product groups by name.
productPageIntegerPage of products to return within each group. Default is 1.
productLimitIntegerNumber of products to return per group. Default is 5.
productSearchStringFilter the products in each group by name or SKU.

cURL Example​

curl --location '<BASE_URL>/productGroup/all?page=1&limit=10&productLimit=3&search=power' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The product groups were returned successfully.
  • 400 Bad Request: The access token is missing or invalid, or does not have the required scope.

Sample JSON Response​

{
"success": true,
"data": [
{
"id": "66d220c8f57178681728212e",
"name": "Power Tools",
"status": true,
"restrictAccess": false,
"hiddenFrom": ["guest"],
"createdAt": "2024-08-30T19:43:04.216Z",
"updatedAt": "2024-08-31T18:18:28.191Z",
"products": [
{
"_id": "64f123abc456789012345679",
"name": "Cordless Drill 18V",
"sku": "CD-18V-001",
"price": 129.99,
"status": "active",
"productGroups": ["66d220c8f57178681728212e"],
"id": "64f123abc456789012345679"
}
],
"productCount": 25,
"productPagination": {
"page": 1,
"total": 25,
"count": 1,
"limit": 3
}
}
],
"pagination": {
"page": 1,
"total": 1,
"count": 1,
"limit": 10
}
}

Response Details​

Product Group Data​

FieldTypeDescription
idStringUnique identifier of the product group.
nameStringName of the product group.
statusBooleanWhether the product group is active. Default is false.
restrictAccessBooleanWhether the group's products are hidden from shoppers who are not given access. Default is false.
hiddenFromArrayShopper types the group's products are hidden from: guest, b2c. Default is [].
productsArrayA page of the group's products. See Get Product.
productCountNumberNumber of products in the group (or matching productSearch).
productPaginationObjectPagination details for products.
createdAtStringDate and time the group was created (ISO 8601).
updatedAtStringDate and time the group was last updated (ISO 8601).

Pagination Details​

FieldTypeDescription
pageNumberCurrent page number.
totalNumberTotal number of product groups.
countNumberNumber of product groups on this page.
limitNumberNumber of product groups per page.

Notes​

  • Products in the sample response are shortened. Each product contains all product fields.
  • guest means shoppers who are not signed in. b2c means signed-in customers who don't belong to a company.