Returns all label assignments for a specified list of entities.
curl -X GET "https://{host}/api_gateway/v2/labels/assignments?entityType=PRODUCT&entityIds=SKU-001,SKU-002&includeInactive=false" \
-H "Authorization: Bearer {token}"
- Requires authentication with a valid bearer token.
- The token must have read access to the Labels resource.
| |
|---|
| Pagination support | No |
| Batch support | Yes |
| Field | Type | Required | Description |
|---|
entityType | enum | Required | Entity type to retrieve assignments for. One of: CUSTOMER, PRODUCT, STORE. |
entityIds | string | Required | Comma-separated list of entity identifiers. Maximum 10 IDs per request. |
includeInactive | boolean | Optional | When true, includes expired assignments in the response. Defaults to false. |
{
"data": [
{
"entityId": "SKU-001",
"labels": [
{
"labelId": 101,
"labelName": "Summer Sale",
"labelExternalId": "SUMMER_SALE",
"expiryDate": "2026-08-31"
}
]
}
]
}
| Field | Type | Description |
|---|
data | array | Label assignments grouped by entity. |
.entityId | string | Entity identifier. |
.labels | array | Labels currently assigned to this entity. |
..labelId | integer | System-assigned identifier of the label. |
..labelName | string | Display name of the label. |
..labelExternalId | string | Caller-defined identifier of the label, or null if not set. |
..expiryDate | string | Expiry date in YYYY-MM-DD format, or null if the assignment does not expire. |
| Code | Error number | Type | Description |
|---|
LABEL_INVALID_ENTITY_TYPE | 23006 | Error | entityType is not one of CUSTOMER, PRODUCT, STORE. HTTP 400. |
ASSIGNMENT_ENTITY_IDS_EXCEEDED | 23042 | Error | More than 10 entity IDs in entityIds. HTTP 400. |