Skip to main content
The embedded storefront is a ready-made gift card shop you place in your site or app with an <iframe>. Your users browse and choose cards inside it; you decide whether they may have them (for example, by spending points in your app); you then pay WizzGift from your prepaid balance. WizzGift delivers the cards straight to the email address the user entered. You never handle card codes, and you never need your own product catalog.

How it works

  1. The user fills a cart in the iframe and enters their email.
  2. WizzGift prices the cart and the iframe posts a signed quote to your page (order-requested).
  3. Your backend charges the user on your side, then redeems the quote with your API key. That creates the order and pays it from your balance.
  4. WizzGift fulfils the order, emails the cards to the user, and sends a signed callback to your server with the outcome.
You need a business account with B2B enabled, an API key with the orders:create and orders:read scopes, a funded balance (see the B2B quickstart), and an https endpoint for callbacks.
1

Get your integration settings

Response (200)
Store signingSecret server-side only. It verifies the callbacks in step 5.
2

Embed the storefront

You can link straight to a section by adding a path before the query string: /gift-cards/<category>, /gift-cards/<product-slug>, /refill (mobile top-ups), or /recharge/<product-slug>.
3

Receive the quote

When the user checks out, the iframe posts a message to your page. Accept it only from the storefront origin and from the iframe you embedded:
Message
orderInfo is a JWT signed by WizzGift. Its payload repeats the quote (totalAmount in USD, items, the user’s email, iframeIntegrationId, and jti, the quote id). You can decode it to show a confirmation, but you can’t verify the signature: WizzGift checks it when you redeem.
Charge your user from the token’s totalAmount, decoded on your server, never from a number sent by the browser. Check that its iframeIntegrationId is yours and exp is in the future, and accept each token (jti) for only one of your orders.
If you passed email and need the cards to go only to that address, compare the token’s email claim with it before redeeming. The user controls the iframe URL and can change the address in the cart.
4

Redeem the quote

From your backend, after you have charged the user:
The response is the order (success: true plus the fields of GET /b2b/orders/{checkoutId}). 201 means a new paid order; 200 means you retried a quote that was already redeemed for the same partnerRef.
5

Handle the callback

When the order reaches completed, partial, or failed, WizzGift sends a POST to your callbackUrl:
  • Verify X-Wizzgift-Signature with your signingSecret, using the same scheme and code as webhook signatures.
  • X-Wizzgift-Event is order.completed, order.partial, or order.failed.
  • Any non-2xx response is retried 3 more times (after about 3, 10, and 30 seconds). Return 2xx once you have recorded the outcome, and make your handler idempotent.
  • WizzGift refunds failed units to your balance automatically. refund_details.amount is the value of every failed unit in USD: return that much to your user. For failed, return the full amount.
For the strongest guarantee, treat the callback as a signal and read the outcome from GET /b2b/orders/{checkoutId}. Its status and failedAmount are authoritative, and its externalRef is iframe:<quoteId>, which ties the order to the token you redeemed.

Card codes and privacy

Cards from the embedded storefront belong to the end user. WizzGift emails them to the address entered in the iframe, and the user can also open them at the link above. Callbacks and the order API show you fulfillment status only; they never include card codes for these orders.

Security checklist

  • Accept order-requested only from https://iframe.wizzgift.com and from your own iframe’s window.
  • Derive the charge from the token on your server; keep one order per token (jti).
  • Redeem only from your backend; keep your API key and signingSecret out of browser code.
  • Use an https callback URL and verify every callback’s signature before acting on it.