AlmondTill/G3N API

On this page

recordRegistryFulfillment

mutation · in the family Selling

What it does

Record that a registry item was bought — the gift is covered.

STAFF: record ONE purchase fact against a registry item: IMMUTABLE once recorded (the TENTH LEDGER_FACT); the registry must be NON-DOOMED (active/closed/expired ALL record — ruling); the item ACTIVE; the order in-tenant + non-doomed; ⚠ the named line's variant MUST equal the item's variant (the fact names its line); OVER-fulfillment records LEGALLY (remaining floors 0). Requires the unrestricted capability. Template class (the capture tier — hand-derived v22).

What happens

The registry’s fulfilment story updates so others do not double-buy.

Who may call it

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

Arguments

NameTypeRequiredNotes
inputRecordRegistryFulfillmentInput RecordRegistryFulfillmentInput!yesNo further notes.

Returns

RegistryFulfillment RegistryFulfillment! — One recorded purchase against a registry item. Purchased qty per item = Σ these rows' qty; remaining = max(0, desired − purchased) — OVER-fulfillment records legally (ruling: facts over gates).

Example request

mutation ExampleRecordRegistryFulfillment($input: RecordRegistryFulfillmentInput!) {
  recordRegistryFulfillment(input: $input) {
    id
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    registryItemId
    orderId
    orderLineNo
    qty
    purchaserConsumerId
  }
}

Variables:

{
  "input": {
    "registryId": "01900000-0000-7000-8000-5a9f6ff30000",
    "registryItemId": "01900000-0000-7000-8000-647eb9380000",
    "orderId": "01900000-0000-7000-8000-f6d8263a0000",
    "orderLineNo": 1,
    "qty": 1,
    "purchaserConsumerId": "01900000-0000-7000-8000-d1660c310000"
  }
}

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

Example response

{
  "data": {
    "recordRegistryFulfillment": {
      "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",
      "registryItemId": "01900000-0000-7000-8000-647eb9380000",
      "orderId": "01900000-0000-7000-8000-f6d8263a0000",
      "orderLineNo": 1,
      "qty": 1,
      "purchaserConsumerId": "01900000-0000-7000-8000-d1660c310000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in