AlmondTill/G3N API

On this page

couponBatchCodes

query · in the family Reading your records

What it does

One batch’s unique codes with their redemption status — the list you export for a campaign.

One batch's child codes with their redemption status, in mint order, born-paginated (limit defaults 50, clamps 1..100; walk until nextToken is null). The batch must exist in YOUR org group. Requires authentication.

What happens

Read-only.

Who may call it

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

Arguments

NameTypeRequiredNotes
batchIdID ID!yesNo further notes.
limitIntnoHow many records to answer at most; a page may hold fewer.
nextTokenStringnoThe cursor from the previous page, passed back exactly as received.

Returns

CouponBatchCodePage CouponBatchCodePage! — One page of a batch's child codes (mint order; walk until nextToken is null).

This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. See paging.

Example request

query ExampleCouponBatchCodes($batchId: ID!, $limit: Int) {
  couponBatchCodes(batchId: $batchId, limit: $limit) {
    items {
      id
      code
      status
      redeemedAt
      orderId
    }
    nextToken
  }
}

Variables:

{
  "batchId": "01900000-0000-7000-8000-cb95c0160000",
  "limit": 1
}

Example response

{
  "data": {
    "couponBatchCodes": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "code": "BJ-001",
          "status": "<status>",
          "redeemedAt": "2027-01-31T00:00:00.000Z",
          "orderId": "01900000-0000-7000-8000-f6d8263a0000"
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in