On this page
assignIdentifier
mutation · in the family Catalog editing
What it does
Assign an identifier (a barcode, a UPC/EAN/SKU) to a variant.
ASSIGN an identifier to a Variant; requires the unrestricted capability. Refusals: a burned SKU → CONFLICT/SKU_TAKEN naming the holder (+holderProduct); a live plu/gtin holder → CONFLICT/IDENTITY_TAKEN (gtin carries overridable: true — pass override to displace); org-scoped kinds gate on an ACTIVE OrgStyle selection of the variant's style (CONFLICT/UNSELECTED — the gate); the identical current value → VALIDATION/INVALID.
Careful
Identifiers must stay unique — a duplicate refuses, naming the holder.
Who may call it
Capability area: Catalog editing — Changing what you sell — the details of styles, products, variants and their identifiers.
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:assignIdentifier
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | AssignIdentifierInput AssignIdentifierInput! | yes | No further notes. |
Returns
IdentifierEntry IdentifierEntry! — ONE ledgered identifier assignment: a kind + value borne by a Variant over an assignment window. sysId-LESS; IMMUTABLE (no edit op exists; supersededAt is the ONE set-once SYSTEM stamp; doomed = VOIDED, a correction).
Example request
mutation ExampleAssignIdentifier($input: AssignIdentifierInput!) {
assignIdentifier(input: $input) {
id
type
caption
status
parentId
rootId
kind
value
organizationId
assignedAt
supersededAt
createdAt
updatedAt
revision
revisionNum
}
}
Variables:
{
"input": {
"variantId": "01900000-0000-7000-8000-8415e73b0000",
"kind": "<kind>",
"value": "<value>",
"organizationId": "01900000-0000-7000-8000-44b781470000"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"assignIdentifier": {
"id": "01900000-0000-7000-8000-37386ae00000",
"type": "<type>",
"caption": "Blue jeans",
"status": "<status>",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"kind": "<kind>",
"value": "<value>",
"organizationId": "01900000-0000-7000-8000-44b781470000",
"assignedAt": "2027-01-31T00:00:00.000Z",
"supersededAt": "2027-01-31T00:00:00.000Z",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revision": "01900000-0000-7000-8000-b7960e180000",
"revisionNum": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. (VALIDATION)