Skip to main content

Get Product Group Rules

Retrieves the companies, company groups or customers that have an access rule for a product group, and whether each one is included or excluded. Each call returns one type of target.

HTTP Request​

  • URL: /productGroup/{id}/rules
  • 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.

Query Parameters​

ParameterTypeDescription
typeStringType of target to list: companies, companyGroups or customers. Default is companies.
pageIntegerPage number to return. Default is 1.
limitIntegerNumber of results per page. Default is 25.
searchStringFilter by name or email.

cURL Example​

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

Response​

  • 200 OK: The rules were returned successfully.
  • 400 Bad Request: The access token is missing or invalid, or type is not one of the allowed values.
  • 404 Not Found: No product group matches the ID.

Sample JSON Response​

{
"success": true,
"data": [
{
"name": "Acme Construction",
"email": "purchasing@acmeconstruction.com",
"id": "6650b1c2d3e4f5a6b7c8d9e0",
"type": "include"
},
{
"name": "Northside Builders",
"email": "orders@northsidebuilders.com",
"id": "6650b1c2d3e4f5a6b7c8d9e1",
"type": "exclude"
}
],
"pagination": {
"page": 1,
"total": 2,
"count": 2,
"limit": 25
}
}

Response Details​

Rule Data​

FieldTypeDescription
idStringID of the company, company group or customer.
nameStringName of the company or company group.
emailStringEmail of the company or customer.
firstNameStringFirst name of the customer. Customers only.
lastNameStringLast name of the customer. Customers only.
typeStringinclude or exclude.

Pagination Details​

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

Notes​

  • Companies and company groups are sorted by name. Customers are sorted by first name, then last name.