# closeGiftRegistry

mutation · in the family [Gift registry](/reference/gift-registry/)

## What it does

Close a gift registry — the event is over.

active → closed (authority:own_registry — on the staff lane authorization rides the channel + role templates; the owner closes via closeMyGiftRegistry). Fulfillments still record on a closed registry (ruling); item mutations refuse (the registry must be ACTIVE).

## Who may call it

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

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

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | yes | The id of the record. |
| `revision` | [ID](/types/#scalars) `ID!` | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
| `reason` | [String](/types/#scalars) | no | No further notes. |

## Returns

[GiftRegistry](/types/GiftRegistry/) `GiftRegistry!` — A GiftRegistry — ONE consumer-OWNED curated product list with purchase tracking (org-group-parented document): structurally a cousin of the Collection but consumer-owned + purchase-tracked. ownerConsumerId is a registered Consumer, IMMUTABLE at birth (ruling — the REGBOOK derived-index row minted in the create txn is thereby write-once; guests cannot own; transfer = deferral 14). registryType ∈ {wedding, baby, birthday, anniversary, holiday, wishlist, custom} (the seven VERBATIM — canned + AT-extensible, the caseType registry class; MUTABLE via update, a mislabel is routine correction). privacy ∈ {public | unlisted | private}, DEFAULT 'private' (strict — the owner opts INTO sharing); ⚠ the cross-consumer READ lanes that consume the gate are the storefront wave (ruling /deferrals 1–3) — until then privacy is enforced STRUCTURALLY (the consumer lane is owner-only). eventDate OPTIONAL — present ⇒ arms the scheduled active → expired (ruling — LIVE machinery, due == eventDate EXACTLY; the ExemptionCertificate optional-field class; grace/policy = deferral 7). FSM: active(i) → closed (caller_op:close · authority:own_registry) · active → expired (scheduled:scheduler — a LIVE non-terminal state: items stay readable, fulfillments still record \[ruling], the owner can still doom) · closed|expired → doomed (caller_op:doom · authority:own_registry + referential_integrity — the inbound-ref set is EMPTY by design, subordinates are FAMILY \[the CollectionMember vacuous-gate class]). Forbidden: active → doomed (close or let expire first). Ceilings: 16 ACTIVE registries/consumer · 200 ACTIVE items/registry. NOT searchable (consumer-owned, reached via its owner — the book law covers WHO, not their lists).

## Example request

```graphql
mutation ExampleCloseGiftRegistry($id: ID!, $revision: ID!, $reason: String) {
  closeGiftRegistry(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    ownerConsumerId
    registryType
    privacy
    eventDate
  }
}
```

Variables:

```json
{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}
```

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

## Example response

```json
{
  "data": {
    "closeGiftRegistry": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "GR-EXMP-0000-000F",
      "type": "GiftRegistry",
      "caption": "Blue jeans",
      "status": "active",
      "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",
      "ownerConsumerId": "01900000-0000-7000-8000-44c7fc050000",
      "registryType": "<registry type>",
      "privacy": "<privacy>",
      "eventDate": "2027-01-31"
    }
  },
  "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/))
