Prerequisites
- A Fluz account — you’ll create staging API credentials and mint an access token in Steps 1–2 below.
- Requests go to the sandbox GraphQL endpoint. Nothing here charges a real card — see Staging vs. Live Environment.
- Every mutation needs a unique
idempotencyKey(a client-generated UUID) so a request is only ever processed once — see Idempotency.
Before you begin
Except for minting your token (Step 2), every call is aPOST request to a single GraphQL endpoint, authenticated with your bearer token:
The full flow
Sign up and register an app
Create a Fluz account at fluz.app, then open the Developer Console and create a new Staging application. When the credentials appear, copy your
clientId and clientSecret — the secret is shown only once.Full walkthrough: Prepare your accounts.Exchange credentials for an access token
Mint a short-lived, scoped user access token from your app credentials. This call goes to the OAuth service; every later call uses the returned token as a Bearer credential.Store the returned
accessToken and send it as Authorization: Bearer <accessToken> on every request below. Tokens are short-lived (expiresIn is in seconds) — mint them server-side and refresh before expiry. Full details: API credentials.Deposit funds to your Fluz balance
Pre-loading a Fluz balance generally makes gift card purchases faster and can bypass certain velocity checks. You can deposit two ways:
- Manually, via the sandbox Fluz website.
- Programmatically, via the
depositCashBalancemutation (shown below).
First, retrieve a payment method ID (getWallet)
First, retrieve a payment method ID (getWallet)
To deposit via API you need the ID of a funding source (e.g. a Grab the
bankCardId). Run getWallet and save the ID you want to use.bankCardId or bankAccountId from the response. Managing funding sources via the API requires the MANAGE_PAYMENT scope. More detail: View Funding Sources.Make the deposit
Use thedepositCashBalance mutation. It takes a DepositCashBalanceInput object.Input fields
A unique client-generated UUID that guarantees the deposit is processed only once.
The amount to deposit.
Destination balance. One of
CASH_BALANCE, GIFT_CARD_BALANCE, or RESERVE_BALANCE.Where the money comes from — provide one of
bankAccountId, bankCardId, or paypalVaultId.Only for
GIFT_CARD_BALANCE. A four-digit MCC classifying the business. Use getMccList to retrieve valid values.When
CASH_BALANCE is selected, the specific spend account to deposit into.Sample response
Sample response
Deposits may settle instantly or within 2–5 business days depending on the funding source and settlement type. The
balances object in the response reflects your current available balance. See Check Account Balance to re-query it at any time.Browse merchants and pick an offer
With a balance ready, fetch the catalog of available merchants and their cashback offers using
getMerchants.Useful arguments
Filter merchants by name.
{ limit, offset }. Default and max limit is 20.Boolean flags for which offer types to return, e.g.
{ giftCardOffer: true, cardLinkedOffer: false }.Filter offers within each merchant, e.g. by
deliveryFormat (URL, CODES, PIN_AS_CODE, PIN_WITH_URL).Pagination: the response may return fewer results than your
limit. To pull the full catalog, keep incrementing offset by your limit and stop when the API returns an empty array ([]). The unfiltered catalog is large — fetch it at most once per day, and use name or offerTypes for targeted lookups.Optional: get the single best offer for a merchant (getOfferQuote)
Optional: get the single best offer for a merchant (getOfferQuote)
If you already know the merchant and amount,
getOfferQuote returns the top available offer directly — including live stock info.slug and denomination are required. paymentMethod defaults to FLUZPAY (your Fluz balance) and also accepts BANK_CARD, BANK_ACCOUNT, PAYPAL, APPLE_PAY, and GOOGLE_PAY.Purchase a gift card
Use the
purchaseGiftCard mutation. You can identify what to buy in two ways:- Option A — Merchant slug (recommended)
- Option B — Specific offer ID
Pass a
merchantSlug and Fluz automatically applies the best available offer for that merchant.Input fields
A unique client-generated UUID so the purchase is processed only once.
Provide one.
merchantSlug auto-selects the best rate; offerId targets a specific offer.The gift card amount to purchase.
How to pay. Use
balanceAmount (Fluz balance), bankAccountId, bankCardId, or paypalVaultId. You may combine your Fluz balance with another source.Falls back to your Fluz balance if another payment method fails. Set to
false to disable that fallback.Minimum reward rate to accept when purchasing via
merchantSlug.Forces a specific exclusive rate. Found in
getMerchants for offers of type EXCLUSIVE_RATE_OFFER.The spend account (cash balance) to charge.
Optional expense metadata.
memo max 255 chars; categories are created on first use. See Add Expense Details.Sample response
Sample response
Hold on to the
giftCardId from the response — you’ll use it to reveal the card in the next step. If a purchase fails, check Gift Card Error Codes.Reveal the gift card details
Finally, retrieve the redeemable details (code, PIN, and/or URL).
Don't have the giftCardId? List your cards first (getGiftCards)
Don't have the giftCardId? List your cards first (getGiftCards)
Skip this if you just captured a You can filter with
giftCardId in Step 3. Otherwise, list your gift cards:status and userCashBalanceId, and page with paginate.Reveal redemption details
CallrevealGiftCardByGiftCardId with the giftCardId.Sample response
Sample response
Redemption fields vary by merchant. Some cards return an alphanumeric
code with no pin; others return only a url. Always render based on the deliveryFormat returned by getGiftCards (not getMerchants) — a merchant’s active offer can change after purchase, and getGiftCards reflects the format the card was actually bought under.You’re done 🎉
You’ve run a complete transaction — funded a balance, browsed offers, purchased a gift card, and revealed it. From here, explore the rest of the API:Virtual Cards
Issue and manage network-accepted virtual cards.
Wallets & Transfers
Open spend accounts and move funds between them.
Transaction Activity
Pull, filter, and annotate transaction history.
Embedded Widgets
Drop Fluz flows straight into your own UI.
Want to learn more? Contact us at support@fluz.app to speak with our experts or request a demo.