Reading balances
Goal: show a member their points, tier, and activity. The three member reads take the same
(channel, external_id) path params and require a secret key (or a scoped-down credential with
loyalty:read).
Balance
Section titled “Balance”GET .../balance — full reference.
curl https://sandbox.usetessera.io/v1/customers/shopify/cust_5512/balance \ -H "Authorization: Bearer $TESSERA_SECRET_KEY"{ "customer_uuid": "c0ffee00-0000-4000-8000-000000000001", "points_label": "points", "spendable_balance": 4200, "pending_spendable": 0, "qualifying_balance": 4200, "active_holds": 500, "clawbacks_outstanding": 0, "available": 3700}const member = tessera.member('cust_5512', { channel: 'shopify' });const balance = await member.balance();console.log(`${balance.available} ${balance.pointsLabel} available`);Redeem against available, not spendable_balance — see Ledger & currencies
for what each field means.
Tier status
Section titled “Tier status”GET .../status — full reference.
curl https://sandbox.usetessera.io/v1/customers/shopify/cust_5512/status \ -H "Authorization: Bearer $TESSERA_SECRET_KEY"{ "customer_uuid": "c0ffee00-0000-4000-8000-000000000001", "current_tier": { "key": "gold", "name": "Gold", "earn_multiplier": 1.5, "reward_eligibility": ["3f2b9c1e-6a4d-4e8f-9b71-2c5d8e0a4f16"] }, "effective_tier_key": "gold", "period_start": "2026-01-01", "period_end": "2026-12-31", "requalification_state": "on_track", "grace_deadline": null, "qualifying_progress": { "current": 4200, "hold_threshold": 2000, "next_tier_key": "platinum", "next_qualify_threshold": 8000 }}qualifying_progress.current is progress within the current status period —
qualifying_balance minus the period checkpoint, clamped at 0. It is the number
hold_threshold and next_qualify_threshold are thresholds for, so compare it against those and
not against the member’s lifetime qualifying_balance from /balance.
current_tier and effective_tier_key are the member’s effective tier: the higher of the tier
they qualified for this period and any lifetime floor they have earned. A member who has slipped
below their period threshold but sits above a lifetime floor keeps the higher tier here.
current_tier.reward_eligibility lists the ids of the /v1/rewards
items whose tier condition includes the member’s tier. Rewards with no tier condition are not listed.
If the merchant has no tier program configured, current_tier and the other tier fields are
null — this is still a 200, not an error. With no program there is no period either, so
qualifying_progress.current is the raw cumulative qualifying balance.
const status = await member.status();console.log('tier:', status.currentTier?.name ?? 'none');Tier ladder
Section titled “Tier ladder”GET /v1/tiers — full reference.
The ladder is the same for every member, so a storefront can render all of it and mark the member’s step. It needs no member:
a publishable key can read it, and client.tiers.list() is the SDK call.
curl "https://sandbox.usetessera.io/v1/tiers?program=cellar" \ -H "Authorization: Bearer $TESSERA_PUBLISHABLE_KEY"{ "program": { "qualification_metric": "qualifying_credits", "status_period": "calendar_year", "downgrade_mode": "immediate", "grace_days": null }, "data": [ { "key": "member", "name": "Member", "display_order": 1, "qualify_threshold": 0, "hold_threshold": 0, "earn_multiplier": 1, "lifetime_threshold": null, "reward_eligibility": [] }, { "key": "insider", "name": "Insider", "display_order": 2, "qualify_threshold": 6, "hold_threshold": 4, "earn_multiplier": 1.25, "lifetime_threshold": null, "reward_eligibility": ["3f2b9c1e-6a4d-4e8f-9b71-2c5d8e0a4f16"] }, { "key": "collector", "name": "Collector", "display_order": 3, "qualify_threshold": 24, "hold_threshold": 18, "earn_multiplier": 1.5, "lifetime_threshold": null, "reward_eligibility": ["3f2b9c1e-6a4d-4e8f-9b71-2c5d8e0a4f16", "9a7c51d2-0b3e-4f68-8d24-6e1f7a3b5c90"] } ]}data is ordered by display_order, ascending. To show a member where they stand, read GET .../status too and compare:
the tier with key equal to effective_tier_key is theirs, and the amount still needed for each higher tier is
max(0, qualify_threshold - qualifying_progress.current). Use qualifying_progress.current, the progress in the
current status period, for that sum: qualify_threshold is a threshold for it. lifetime_threshold is different: it is
tested against the member’s cumulative qualifying_balance from /balance, and it is null unless the programme has a
lifetime tier. The example below is a wine club that counts bottles as qualifying credits.
// Copperline Cellar Club: Member, Insider, Collectorconst [ladder, status] = await Promise.all([tessera.tiers.list(), member.status()]);for (const tier of ladder.data) { const needed = Math.max(0, tier.qualifyThreshold - status.qualifyingProgress.current); console.log(tier.key === status.effectiveTierKey ? `${tier.name}: you are here` : `${tier.name}: ${needed} more bottles`);}reward_eligibility lists the ids of the /v1/rewards items that need this tier; a reward with no
tier condition is listed under no tier. With no tier programme configured, the answer is { "program": null, "data": [] }.
program is an object here, with the programme’s tier rules; on checkout redemptions, program is the programme’s handle.
grace_days is null unless downgrade_mode is grace_window. Like /v1/rewards, the answer may be cached for up to
five minutes, and a publishable key that names a programme that is not active gets a 404.
History
Section titled “History”GET .../history — full reference.
curl "https://sandbox.usetessera.io/v1/customers/shopify/cust_5512/history?limit=20" \ -H "Authorization: Bearer $TESSERA_SECRET_KEY"for await (const entry of member.history()) { console.log(entry.type, entry.currency, entry.amount, entry.sourceRef);}See Pagination for the cursor and filter details.
Common errors
Section titled “Common errors”code | Status | Cause |
|---|---|---|
customer_not_found | 404 | No member matches this (channel, external_id) in this tenant. |
invalid_request | 400 | (History only) a malformed limit/since/until. |