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; the active-items ceiling (200) gates; the variant live-gates. A non-ACTIVE registry refuses CONFLICT/REF_STATE. Requires the unrestricted capability. Template class (hand-derived v22).
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Selling — Ringing sales, serving customers and issuing invoices.
Roles that may call it:
- Owner
- Manager
- Associate Manager
- Sales Associate
- An API key whose scope allows
api:addRegistryItem
What happens
The item joins the registry with its wanted quantity; purchases against the registry track fulfilment.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | NewRegistryItemInput NewRegistryItemInput! | yes | Item ADD input — shared by both lanes. |
Returns
RegistryItem RegistryItem! — One desired variant on a GiftRegistry. variantId is the membership identity (immutable — remove + re-add instead); remove = doom, history preserved.
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-3255b1ae0000",
"variantId": "01900000-0000-7000-8000-8433b0260000",
"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-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"variantId": "01900000-0000-7000-8000-8433b0260000",
"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
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (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)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)