1
Find the offer
Pull the catalog, or ask for the best rate on one merchant. → Read the catalog
2
Confirm the amount is purchasable
Fixed or variable, stocked or generated on demand. → Fixed vs. variable
3
Buy
One mutation, one card, one idempotency key. → Buying
4
Reveal
Get the code, PIN, or URL, and render it correctly. → Revealing
Vocabulary
Five terms do most of the work in this section, and three of them sound alike.
Two identifiers are easy to confuse:
merchantId identifies the brand, offeringMerchantId identifies the party offering that particular deal. You buy against an offerId or a slug, never against a merchantId.
Reading the catalog
Three ways in, for three different jobs.
Filter
getMerchants to gift cards with offerTypes: { giftCardOffer: true, cardLinkedOffer: false }. Card-linked offers exist in the catalog but only gift card and exclusive offers are purchasable through the API today.
The full catalog is a cached file, refreshed twice daily.
getOfferQuote is live. If the exact rate matters at purchase time — and it usually does — quote before you buy rather than trusting a catalog pull from this morning. Promotional rates are reflected in both, including in CSV exports generated during a promotion.Exclusive offers
Rates are customized per account. If yours has negotiated rates, they appear as offers withtype: "EXCLUSIVE_RATE_OFFER" carrying an exclusiveRateId. Pass that ID to purchaseGiftCard to force the purchase onto that rate; omit it and Fluz picks the best available.
Fixed vs. variable offers
This is the distinction that most shapes how you build, and a merchant can have both.FIXED
The card comes in preset denominations — 50, $100 — and you buy one of them exactly.Frequently backed by real inventory Fluz holds, which is why fixed offers usually carry better rates and higher purchasing limits.Inventory is finite. It runs out.
VARIABLE
You choose any amount within a min/max range, and the card is generated in real time.No inventory to deplete — effectively unlimited supply.Usually a lower reward rate than the same brand’s fixed offer.
Where to read the purchasable amounts
Two fields decide this, and the combination determines which field holds the answer. Get this wrong and you’ll submit amounts the offer can’t fulfill.
Note that “has stock info” doesn’t mean “has countable stock.” On a variable offer,
stockInfo returns a range, not a quantity. Only StockInfoFixedType carries an availableStock number you can decrement against.
Populating stockInfo requires Fluz to confirm inventory with the vendor, and vendor response times vary — so requesting it makes the query slower. Only ask for it when you’re about to act on it. → Get Inventory on Stocked Offers
Buying a card
One mutation:purchaseGiftCard. Three decisions.
1. How to pick the offer
Pinning gives you certainty about the rate; auto-select gives you certainty about fulfillment.
merchantSlug + minRewardRate is the middle ground and usually the right default for automated ordering.
2. How to pay
At least one funding source is required, and you can combine your Fluz balance with another.3. Idempotency
idempotencyKey is required, and it’s the difference between a retry and a double purchase. One key per intended card, reused on every retry of that same card. → Idempotency
→ Purchase Gift Card
Buying more than one
One call buys exactly one card, on one offer, at one rate. There’s no quantity field and no blending across offers. For ten cards, send ten calls with ten distinct idempotency keys. What happens when you outrun inventory depends on how you picked the offer:- Pinned (
offerId) — once the stocked offer is depleted, remaining calls fail. No automatic fallback. - Auto-select (
merchantSlug) — remaining calls move to the next-best offer, often a variable one at a lower rate, unlessminRewardRateblocks it.
Ordering at volume
Purchases against the same Fluz account process sequentially. Fire a large batch at once and calls queue behind each other, occasionally taking minutes to return.A client timeout is not a cancellation. Fluz keeps processing a request you’ve stopped waiting for. Treat a timeout as an unknown outcome, never a failure.Resolve it by retrying with the same
idempotencyKey — the retry returns the original purchase if it already succeeded, and won’t double-charge. Issuing a fresh key for a purchase you already attempted is exactly how duplicate orders happen.Set client timeouts to about a minute, pace requests in waves rather than all at once, and spread heavy volume across multiple accounts.Revealing the card
A purchase gives you agiftCardId. Redemption details come from a second call.
1
Get the gift card
Skip this if you just purchased and already hold the
giftCardId. Otherwise getGiftCards lists them with purchaseId, purchaseDisplayId, purchaseValue, currentValue, and status — enough to reconcile orders without revealing every card.2
Reveal it
revealGiftCardByGiftCardId returns code, pin, url, and termsAndConditions.- Not every card has all three fields. Some merchants issue a code with no PIN; some issue only a URL. Fluz passes through whatever the merchant provides — handle nulls.
- Render according to
deliveryFormatandbarcodeType, and takedeliveryFormatfromgetGiftCards, not from the merchant’s current offer. Offers change; the card was issued under the format in force at purchase time.barcodeTypeisNONE,C128,PDF417, orQRCODE; when it’sNONE, consider displaying thefaceplateUrlinstead. - Details may not be ready instantly. Poll with exponential backoff — 300ms, doubling, capped at three minutes — and stop as soon as details return.
Scopes
Enable these on your app’s Permissions tab before you build. A scope you request but haven’t enabled is silently dropped. → Configure OAuth App
When things fail
Full list: Gift Card Error Codes.
Before refunding an end user on a failed or timed-out purchase, retry with the same
idempotencyKey or look up the purchase by ID. Timed-out requests frequently succeeded, and the code stays revealable until the purchase is refunded.
Next steps
Get catalog
Pull merchants and their offers.
Get the best offer
Live quote for one merchant and amount.
Get inventory
Stock on fixed, stocked offers.
Purchase a gift card
The mutation, in full.
Purchase in bulk
Ordering many cards, and depletion behavior.
View gift cards
Reveal codes, PINs, and URLs.