AlmondTill/G3N API

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; a live plu/gtin holder → CONFLICT/IDENTITY_TAKEN; org-scoped kinds gate on an active OrgStyle selection of the variant's style (CONFLICT/UNSELECTED — the gate); the identical current value → VALIDATION/INVALID.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Catalog editing — Changing what you sell — the details of styles, products, variants and their identifiers.

Roles that may call it:

Careful

Identifiers must stay unique — a duplicate refuses, naming the holder.

Arguments

NameTypeRequiredNotes
inputAssignIdentifierInput AssignIdentifierInput!yesAssign-input for assignIdentifier.

Returns

IdentifierEntry IdentifierEntry! — ONE ledgered identifier assignment: a kind + value borne by a Variant over an assignment window.

Example request

graphql
mutation ExampleAssignIdentifier($input: AssignIdentifierInput!) {
  assignIdentifier(input: $input) {
    id
    type
    caption
    status
    parentId
    rootId
    kind
    value
    organizationId
    assignedAt
    supersededAt
    createdAt
    updatedAt
    revision
    revisionNum
  }
}

Variables:

json
{
  "input": {
    "variantId": "01900000-0000-7000-8000-8433b0260000",
    "kind": "<kind>",
    "value": "<value>",
    "organizationId": "01900000-0000-7000-8000-1971e30a0000"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "assignIdentifier": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "type": "<type>",
      "caption": "Blue jeans",
      "status": "<status>",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "kind": "<kind>",
      "value": "<value>",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "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-53c6eea90000",
      "revisionNum": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in