AlmondTill/G3N API

On this page

addRegistryItem

mutation · in the family Selling

What it does

Add a product to a customer’s gift registry, as staff.

STAFF: add ONE item to an ACTIVE registry: the (registry × variant) marker mints in the SAME transaction (a LIVE holder refuses CONFLICT/IDENTITY_TAKEN naming it; a DOOMED holder is TAKEN OVER — re-add after remove, ruling); the ACTIVE-items ceiling (200) gates; the variant live-gates. A non-ACTIVE registry refuses CONFLICT/REF_STATE (ruling). Requires the unrestricted capability. Template class (hand-derived v22).

What happens

The item joins the registry with its wanted quantity; purchases against the registry track fulfilment.

Who may call it

Capability area: Selling — Ringing sales, serving customers and issuing invoices.

Arguments

NameTypeRequiredNotes
inputNewRegistryItemInput NewRegistryItemInput!yesNo further notes.

Returns

RegistryItem RegistryItem! — One desired variant on a GiftRegistry. variantId is the membership identity (IMMUTABLE — remove + re-add instead); REMOVE = doom, history preserved (re-adding TAKES OVER the doomed marker — ruling).

Example request

mutation ExampleAddRegistryItem($input: NewRegistryItemInput!) {
  addRegistryItem(input: $input) {
    id
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    variantId
    desiredQty
    priority
    note
  }
}

Variables:

{
  "input": {
    "registryId": "01900000-0000-7000-8000-5a9f6ff30000",
    "variantId": "01900000-0000-7000-8000-8415e73b0000",
    "desiredQty": 1,
    "priority": "<priority>"
  }
}

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

Example response

{
  "data": {
    "addRegistryItem": {
      "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",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "variantId": "01900000-0000-7000-8000-8415e73b0000",
      "desiredQty": 1,
      "priority": "<priority>",
      "note": "Restock before the weekend."
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in