# recordRegistryFulfillment

mutation · in the family [Selling](/reference/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.

- Owner
- Manager
- Associate Manager
- Sales Associate
- Cashier
- An API key whose scope allows `api:recordRegistryFulfillment`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | [RecordRegistryFulfillmentInput](/types/RecordRegistryFulfillmentInput/) `RecordRegistryFulfillmentInput!` | yes | No further notes. |

## Returns

[RegistryFulfillment](/types/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

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

Variables:

```json
{
  "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

```json
{
  "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

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/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](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))

## Used in

- [Build a gift registry for a shopper](/use-cases/build-a-gift-registry/)
