AlmondTill/G3N API

On this page

coupons

query · in the family Coupon

What it does

The coupon list — each entry is a coupon — a code a customer presents for a reduction.

The caller's org-group family's ACTIVE LISTING of Coupons — doomed records DROP from listings.

What happens

Reads only — changes nothing.

Who may call it

Capability area: Reading your records — Looking up and listing the records of your organization.

Returns

Coupon [Coupon!]! — A Coupon — the CODE-GATED entry to the discount engines: a normalized code (trim+UPPERCASE, stored normalized-only, IMMUTABLE at birth — re-code = a new coupon) that either UNLOCKS a couponGated Promotion (trigger flavor — the reduction is source=promo at position 3) or CARRIES its own simple effect (discount flavor — source=coupon at position 2, BEFORE promotions). Attach to an OPEN order via applyOrderCoupon (HARD 1 coupon/order — the strict default); redemption counts per ORDER in the place transaction — a capped-out coupon refuses CONFLICT/COUPON_EXHAUSTED. NAMED deferrals: CouponBatch (unique single-use child codes) · per-customer caps.

Example request

query ExampleCoupons {
  coupons {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    flavor
    code
    promotionId
    startAt
    endAt
    totalUsesCap
  }
}

Example response

{
  "data": {
    "coupons": [
      {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "sysId": "CP-EXMP-0000-000F",
        "type": "Coupon",
        "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",
        "flavor": "trigger",
        "code": "BJ-001",
        "promotionId": "01900000-0000-7000-8000-59bbd0c70000",
        "startAt": "2027-01-31T00:00:00.000Z",
        "endAt": "2027-01-31T00:00:00.000Z",
        "totalUsesCap": 1
      }
    ]
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer