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.

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

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

Variables:

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

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

Example response

{
  "data": {
    "createGiftRegistry": {
      "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
        }
      }
    }
  }
}

addRegistryItem

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

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-5a9f6ff30000",
    "variantId": "01900000-0000-7000-8000-8415e73b0000",
    "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-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",
      "variantId": "01900000-0000-7000-8000-8415e73b0000",
      "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

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
        }
      }
    }
  }
}