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_PRODUCTGROUPorREAD_WRITE_PRODUCTGROUP
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the product group. |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
type | String | Type of target to list: companies, companyGroups or customers. Default is companies. |
page | Integer | Page number to return. Default is 1. |
limit | Integer | Number of results per page. Default is 25. |
search | String | Filter 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
typeis 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
| Field | Type | Description |
|---|---|---|
id | String | ID of the company, company group or customer. |
name | String | Name of the company or company group. |
email | String | Email of the company or customer. |
firstName | String | First name of the customer. Customers only. |
lastName | String | Last name of the customer. Customers only. |
type | String | include or exclude. |
Pagination Details
| Field | Type | Description |
|---|---|---|
page | Number | Current page number. |
total | Number | Total number of matching results. |
count | Number | Number of results on this page. |
limit | Number | Number of results per page. |
Notes
- Companies and company groups are sorted by name. Customers are sorted by first name, then last name.