AlmondTill/G3N API

Start a loyalty programme and enrol members

Define how customers earn and redeem points, enrol members, and correct a member’s points with a reason when you must — every entry stays in the ledger.

Promotions & loyalty · a play in 4 steps.

In the office

Decide how shoppers earn and redeem points, name the tiers and their thresholds, enrol members, and — when you must — correct a member’s points with a reason that stays on their ledger. Raising a tier’s threshold changes who earns the better rate from that day on; nobody’s past points move.

Where it starts: the office’s Loyalty programs page.

Loyalty programs — /loyalty-programs
Loyalty programs — /loyalty-programs

Step 1. Define the programme — how points are earned and redeemed. Open Loyalty programs.

Step 2. Enrol a customer as a member. Open Loyalty members.

Loyalty members — /loyalty-members
Loyalty members — /loyalty-members

Step 3. Add or remove a member’s points with a reason — a signed, visible ledger entry.

Step 4. Read a member’s points history — every earn, redemption and adjustment.

What you see

The example shop’s programme is Vale Circle — 1 point per CAD 1.00 spent; 100 points redeem CAD 5.00; the tiers Insider (from 0 points) · Gold (from 2000 points, ×1.5). One of its members holds 2509 points over 8 entries (2025-10-13..2026-10-12).

Try it

Walked with screenshots in the owner’s manual: chapter 3 — Run the loyalty programme

For developers — the calls

The steps

  1. Define the programme — how points are earned and redeemed. — createLoyaltyProgram
  2. Enrol a customer as a member. — createLoyaltyMember
  3. Add or remove a member’s points with a reason — a signed, visible ledger entry. — adjustLoyaltyPoints
  4. Read a member’s points history — every earn, redemption and adjustment. — loyaltyLedger

The calls

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

createLoyaltyProgram

createLoyaltyProgram — mutation · Create a new your loyalty program — how customers earn and redeem points at your organization.

Example request

graphql
mutation ExampleCreateLoyaltyProgram($input: NewLoyaltyProgramInput!) {
  createLoyaltyProgram(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    currency
    organizationIds
    startAt
    endAt
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "currency": "USD",
    "earnRate": {
      "points": 1,
      "perMinor": 1250
    },
    "redeemRate": {
      "points": 1,
      "perMinor": 1250
    }
  }
}

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

Example response

json
{
  "data": {
    "createLoyaltyProgram": {
      "id": "01900000-0000-7000-8000-2a5697370000",
      "sysId": "LP-EXMP-0000-000F",
      "type": "LoyaltyProgram",
      "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",
      "currency": "USD",
      "organizationIds": [
        "01900000-0000-7000-8000-1971e30a0000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "endAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

createLoyaltyMember

createLoyaltyMember — mutation · Create a new customer’s membership in your loyalty program at your organization.

Example request

graphql
mutation ExampleCreateLoyaltyMember($input: NewLoyaltyMemberInput!) {
  createLoyaltyMember(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    pointsBalance
    currentTier
    priceGroupId
    consumerId
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "programId": "01900000-0000-7000-8000-c4253b6b0000",
    "customer": {
      "name": "Blue jeans",
      "email": "<the person’s email address>"
    }
  }
}

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

Example response

json
{
  "data": {
    "createLoyaltyMember": {
      "id": "01900000-0000-7000-8000-7863f92f0000",
      "sysId": "LM-EXMP-0000-000F",
      "type": "LoyaltyMember",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-2a5697370000",
      "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",
      "pointsBalance": 1,
      "currentTier": "<current tier>",
      "priceGroupId": "01900000-0000-7000-8000-99e80f9d0000",
      "consumerId": "01900000-0000-7000-8000-3cbb3ce90000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

adjustLoyaltyPoints

adjustLoyaltyPoints — mutation · Manually add or remove a customer’s loyalty points, with a reason.

Example request

graphql
mutation ExampleAdjustLoyaltyPoints($memberId: ID!, $revision: ID!, $points: Int!, $reason: String!) {
  adjustLoyaltyPoints(memberId: $memberId, revision: $revision, points: $points, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    pointsBalance
    currentTier
    priceGroupId
    consumerId
  }
}

Variables:

json
{
  "memberId": "01900000-0000-7000-8000-fef5fce30000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "points": 1,
  "reason": "Correcting a miscount."
}

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

Example response

json
{
  "data": {
    "adjustLoyaltyPoints": {
      "id": "01900000-0000-7000-8000-7863f92f0000",
      "sysId": "LM-EXMP-0000-000F",
      "type": "LoyaltyMember",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-2a5697370000",
      "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",
      "pointsBalance": 1,
      "currentTier": "<current tier>",
      "priceGroupId": "01900000-0000-7000-8000-99e80f9d0000",
      "consumerId": "01900000-0000-7000-8000-3cbb3ce90000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

loyaltyLedger

loyaltyLedger — query · A loyalty member’s points history — every earn, redemption, and adjustment.

Example request

graphql
query ExampleLoyaltyLedger($memberId: ID!, $limit: Int) {
  loyaltyLedger(memberId: $memberId, limit: $limit) {
    id
    parentId
    entryType
    points
    reason
    orderId
    returnId
    caption
    createdAt
  }
}

Variables:

json
{
  "memberId": "01900000-0000-7000-8000-fef5fce30000",
  "limit": 1
}

Example response

json
{
  "data": {
    "loyaltyLedger": [
      {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
        "entryType": "earn",
        "points": 1,
        "reason": "Correcting a miscount.",
        "orderId": "01900000-0000-7000-8000-18e782370000",
        "returnId": "01900000-0000-7000-8000-cc01b1df0000",
        "caption": "Blue jeans",
        "createdAt": "2027-01-31T00:00:00.000Z"
      }
    ]
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}