AlmondTill/G3N API

CouponBatch

object type

A CouponBatch: a Coupon-parented batch of unique single-use child codes (the campaign lane). Each child code is a KEY to the parent coupon's terms — the parent's flavor/window/cap/eligibility verdicts run unchanged at attach and the parent's redeem counter counts every use; the child adds exactly ONE law: it redeems once (the stamp rides the place transaction conditioned — a lost race between two carts refuses the second placement). Minted whole in ONE transaction (≤48 codes — the ceiling IS the transaction bound; bigger campaigns mint more batches) via the bespoke createCouponBatch; the codes are server-generated (<prefix>-<random tail> — unguessable, never caller-supplied), take the same org-group code-namespace uniq marker parent codes use, and are listable via couponBatchCodes (campaign codes are distribution artifacts, not secrets). Dooming the batch voids its unredeemed children (attach refuses naming the batch) while redeemed history stands; a clawed-back child (a cancelled order) is redeemable again — the customer's code survives a voided sale.

Fields

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The human-readable id, shaped like CB-… — stable for the record’s life.
typeString String!The kind of record — always CouponBatch here.
captionString String!The record’s display name — what people see it called.
statusString String!The record’s current state — one of active or doomed.
parentIdID ID!The parent Coupon whose terms every child unlocks — immutable at birth (re-parent = a new batch); parentId!== rootId always.
rootIdID ID!The id of your organization group — every record of yours carries the same one.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The id of the record’s current edit — send it back with a change so an edit made in the meantime is refused instead of overwritten.
refCaptionsRefCaption [RefCaption!]!The captions of the records this one refers to, composed for you — one row per referenced id; see RefCaption.
codePrefixString String!The normalized prefix every child code carries (<prefix>-<tail>) — immutable at birth.
codeCountInt Int!The minted child count (1..48 — the one-transaction bound); immutable (the batch is born whole).

Used by