Skip to main content
Use GetGiftCards to retrieve the top gift cards available to a player in the ZBD rewards web app, along with each card’s price in satoshis and the player’s progress toward unlocking it. This lets you show players how close they are to earning a specific gift card.

Prerequisites

  • Requires Unity SDK v1.1.7 or above. GetGiftCards isn’t available in earlier SDK versions.
  • The SDK must be initialized. GetGiftCards relies on the gift-card web view, which loads during Init — so it works even while the modal is closed, but Init must have completed. Check ZBDController.Instance.initialized before calling.
  • Gift cards must be an available cashout option. If gift-card cashout isn’t enabled for your app or isn’t available in the player’s region, giftCards comes back empty (with success = true).
  • Requests made too early are queued. If the web app is still loading when you call, the request is held and sent automatically once it’s ready.

Response

GetGiftCards returns a ZBDGiftCardsResponse: Each ZBDGiftCard:

Example response

In this example the player has 125 sats and the cheapest Amazon US card costs 7,150 sats, so unlockedPercent is roughly 1.75% (125 ÷ 7,150).

Showing progress to players

Because unlockedPercent is a straight 0–100 percentage, you can bind it directly to a progress bar to show how close a player is to unlocking each card. Combine it with logoUrl, name, and denomination / denominationCurrency to build a “gift card progress” panel that motivates players to keep earning.
Prices are always returned in satoshis, even when your game uses points and a fiat value like USD. priceInSats and availableBalanceInSats are denominated in sats because ZBD’s gift-card provider uses Bitcoin as its base currency — this is independent of the currency your game rewards or displays in.You do not need to show sats to your players, and we recommend you don’t. Show unlockedPercent — a percentage toward the card — rather than a sats amount. A progress percentage reads naturally regardless of your game’s currency; a raw sats price does not.
Handle the edge cases: an empty giftCards array means no cards are available to the player, and any card with unlockedPercent = -1 should be skipped (or shown without a progress value), since that means progress couldn’t be calculated.