AlmondTill/G3N API

storedValueLedger

query · in the family Reading your records

What it does

A gift card / store credit’s full money story — every load and redemption.

With the instrument GET (cached balanceMinor — stamped in the same transaction as every entry) this IS the balance story.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

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

Roles that may call it:

What happens

Reads only.

Arguments

NameTypeRequiredNotes
instrumentIdID ID!yes
limitIntnoHow many records to answer at most; a page may hold fewer.
beforeIDno

Returns

StoredValueEntry [StoredValueEntry!]! — ONE immutable stored-value balance fact: the signed amountMinor IS the balance direction; the parent instrument's balanceMinor was stamped in the same transaction. Corrections are NEW adjust entries, never edits.

Example request

graphql
query ExampleStoredValueLedger($instrumentId: ID!, $limit: Int) {
  storedValueLedger(instrumentId: $instrumentId, limit: $limit) {
    id
    parentId
    entryType
    amountMinor
    currency
    reason
    orderId
    tenderId
    returnId
    caption
    createdAt
  }
}

Variables:

json
{
  "instrumentId": "01900000-0000-7000-8000-87615d500000",
  "limit": 1
}

Example response

json
{
  "data": {
    "storedValueLedger": [
      {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
        "entryType": "issue",
        "amountMinor": 1250,
        "currency": "USD",
        "reason": "Correcting a miscount.",
        "orderId": "01900000-0000-7000-8000-18e782370000",
        "tenderId": "01900000-0000-7000-8000-337e28070000",
        "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
        }
      }
    }
  }
}

Errors this call can answer

Used in