Skip to main content

Get Product Group

Retrieves a single product group and a page of the products assigned to it.

HTTP Request​

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

Path Parameters​

ParameterTypeDescription
idStringRequired. The ID of the product group to retrieve.

Query Parameters​

ParameterTypeDescription
pageIntegerPage of products to return. Default is 1.
limitIntegerNumber of products per page. Default is 10.
searchStringFilter the group's products by name or SKU.

cURL Example​

curl --location '<BASE_URL>/productGroup/66d220c8f57178681728212e?page=1&limit=10' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The product group was returned successfully.
  • 400 Bad Request: The access token is missing or invalid, or the product group ID is not valid.
  • 404 Not Found: No product group matches the ID.

Sample JSON Response​

{
"success": true,
"data": {
"productGroup": {
"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"
}
],
"pagination": {
"page": 1,
"total": 25,
"count": 10,
"limit": 10
}
}
}

Response Details​

Data Object​

FieldTypeDescription
productGroupObjectThe product group. See Get All Product Groups.
productsArrayA page of the group's products. See Get Product.
paginationObjectPagination details for products. See below.

Pagination Details​

FieldTypeDescription
pageNumberCurrent page number.
totalNumberTotal number of matching products.
countNumberNumber of products on this page.
limitNumberNumber of products per page.

Notes​

  • Products in the sample response are shortened. Each product contains all product fields.