AlmondTill/G3N API

Build a gift registry for a shopper

Create the registry, add the products the shopper wants with their quantities, and record each purchase against it so others do not double-buy.

Customers · a play in 3 steps.

In the office

Create the registry for the occasion, add the products the shopper wants with their quantities, and record each purchase against it so nobody buys the same thing twice.

Where it starts: the office’s Gift registries page.

Gift registries — /gift-registries
Gift registries — /gift-registries

Step 1. Create the shopper’s registry.

Step 2. Add a product with the wanted quantity.

Step 3. Record that an item was bought — the registry shows it covered.

What you see

The example shop, Linden & Vale, keeps one registry per occasion; a purchase recorded against it shows the item covered. The registry’s page lists every product with the quantity wanted and the quantity bought, so whoever is at the counter next sees at once what is still open.

Try it

Walked with screenshots in the stylist’s manual: chapter 6 — Build a gift registry for a shopper

For developers — the calls

The steps

  1. Create the shopper’s registry. — createGiftRegistry
  2. Add a product with the wanted quantity. — addRegistryItem
  3. Record that an item was bought — the registry shows it covered. — recordRegistryFulfillment

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

createGiftRegistry

createGiftRegistry — mutation · Create a new customer’s gift registry at your organization.

Example request

graphql
mutation ExampleCreateGiftRegistry($input: NewGiftRegistryInput!) {
  createGiftRegistry(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    ownerConsumerId
    registryType
    privacy
    eventDate
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "registryType": "<registry type>",
    "consumerId": "01900000-0000-7000-8000-3cbb3ce90000"
  }
}

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

Example response

json
{
  "data": {
    "createGiftRegistry": {
      "id": "01900000-0000-7000-8000-b267e3080000",
      "sysId": "GR-EXMP-0000-000F",
      "type": "GiftRegistry",
      "caption": "Blue jeans",
      "status": "active",
      "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": 0,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "ownerConsumerId": "01900000-0000-7000-8000-954407180000",
      "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
        }
      }
    }
  }
}

addRegistryItem

addRegistryItem — mutation · Add a product to a customer’s gift registry, as staff.

Example request

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

Variables:

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

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

recordRegistryFulfillment

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

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-3255b1ae0000",
    "registryItemId": "01900000-0000-7000-8000-21c97c6d0000",
    "orderId": "01900000-0000-7000-8000-18e782370000",
    "orderLineNo": 1,
    "qty": 1,
    "purchaserConsumerId": "01900000-0000-7000-8000-168ef9fc0000"
  }
}

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-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",
      "registryItemId": "01900000-0000-7000-8000-21c97c6d0000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "orderLineNo": 1,
      "qty": 1,
      "purchaserConsumerId": "01900000-0000-7000-8000-168ef9fc0000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}