Back to blog

Selling Gift Cards on WhatsApp with the FazerCards API

FazerCards
Selling Gift Cards on WhatsApp with the FazerCards API

WhatsApp has 2.5 billion active users and is the primary messaging app across Southeast Asia, the Middle East, South Asia, and Latin America — markets where gift card demand is among the highest in the world. A reseller who wires the FazerCards API to a WhatsApp bot can accept orders, confirm purchases, and deliver codes automatically, around the clock, with no storefront required. This guide covers the full path: from a new Meta developer account to a working integration that processes orders and delivers codes in seconds.

Prerequisites

Have the following ready before you start:

  • A WhatsApp Business Account (WABA) verified through Meta for Developers
  • A dedicated phone number not linked to any personal WhatsApp account
  • A FazerCards account with API access — the free 5-day Gold trial gives you full API and catalog access immediately, no card or KYC required
  • A public HTTPS endpoint (a VPS, cloud function, or Lambda) that Meta can reach to deliver webhook events
  • Working knowledge of Node.js or Python — FazerCards publishes official SDKs for both (Node: npm install fazercards; Python: pip install fazercards) along with ready-to-adapt examples in the API cookbook

Step 1: Create your WhatsApp Cloud API application

In the Meta for Developers portal, create a new Business app and add the WhatsApp product. In the WhatsApp configuration panel, note three values you will use throughout the integration:

  1. Phone Number ID — identifies your sending number in every API call
  2. Access token — use a permanent System User token in production, not the temporary token the portal shows by default
  3. Webhook Verify Token — a string you choose, which Meta echoes back once during the initial subscription handshake. It is not sent with later webhooks: authenticate each inbound POST by verifying the X-Hub-Signature-256 header against your app secret

Step 2: Stand up your webhook endpoint

Meta sends every inbound user message to your webhook as an HTTP POST. Your endpoint has two jobs:

  1. Respond to the initial GET request (the verification handshake) by returning the hub.challenge value Meta sends — this proves you control the URL
  2. Accept POST bodies containing message events, parse the message text, and return HTTP 200 within 20 seconds to prevent Meta from retrying delivery

Structure your handler to acknowledge receipt immediately (return 200), then hand off order processing to an async worker. This prevents timeouts if the FazerCards API call takes a few seconds. For the delivery side, the same async pattern is documented in the FazerCards webhooks guide.

Step 3: Design your product menu and command vocabulary

Keep commands short so customers on mobile can type them without errors:

  • LIST — the bot replies with a text menu of available gift card categories, pulled from the FazerCards catalog via the product search endpoint
  • BUY [product] [denomination] — triggers a lookup and an order confirmation prompt
  • STATUS [order_id] — returns delivery status for a specific order

On each BUY command, query the FazerCards catalog to confirm the product and denomination exist, then reply with the price and ask for confirmation before charging. This two-step flow catches typos before they become costly order mistakes.

Step 4: Place orders through the FazerCards API

When the customer confirms (for example by replying YES), call the FazerCards order endpoint documented in /docs. The body carries the product identifiers from the catalog and a quantity; alongside it, send an Idempotency-Key header — a unique string you generate per order (combining the WhatsApp message ID with your account ID works well) and store alongside the order record. If Meta delivers the same webhook twice due to a network hiccup, the idempotency key prevents a duplicate charge at FazerCards.

FazerCards delivers most gift cards and game top-ups within seconds — the API response for these products contains the code or PIN directly. For slower product types, set a polling interval against the order status endpoint and send the code as a follow-up message once status transitions to completed.

Step 5: Send the code back through WhatsApp

Use the WhatsApp Cloud API Messages endpoint to deliver the code. Meta requires an approved message template for first contact with a new number; regular text messages work for replies within an open 24-hour conversation window. Structure the delivery message clearly:

  • Product name and denomination
  • The gift card code or PIN
  • Redemption instructions (the FazerCards catalog exposes per-category notes)
  • Your support contact for failed redemptions

Put the code in a clearly labeled field so the customer can copy it easily on mobile. Never bury the code inside a paragraph of text.

Step 6: Handle errors, duplicates, and delivery failures

Three failure scenarios need explicit code paths:

Stock-out or product error — if FazerCards returns an error (product unavailable, out of stock), reply to the customer immediately with an apology and offer alternatives from the same category. Do not charge.

Delivery delay — if fulfillment takes longer than expected, send the customer a processing notification, then deliver the code as a follow-up message when the order completes. Silence after a payment confirmation destroys customer trust.

Duplicate webhook — Meta occasionally retries delivery. Before sending a code, check whether you have already delivered one for this WhatsApp message ID, to avoid confusing the customer with duplicate messages.

For dispute handling and evidence logging, the guide on building an order evidence trail for digital goods resellers covers the fields worth capturing per transaction.

What you have at the end

After completing this setup, you have a 24/7 sales channel that:

  • Takes orders through the messaging app your customers already use
  • Delivers codes from a catalog of 10,000+ products across 700+ games
  • Handles duplicates, errors, and timeouts without manual intervention

WhatsApp is especially effective for bulk orders from small regional retailers — many prefer a quick message to logging into a web portal. If your customer base also uses Telegram, the order logic is identical; see the Telegram bot guide for the channel-specific differences.

The FazerCards API cookbook has ready-to-adapt samples for the order and delivery flow. To go deeper on real-time order tracking, the webhooks documentation covers signature verification, retry handling, and event types.

Grab the free 5-day Gold trial to get your API credentials and run the full order-to-delivery cycle with a few small real orders before connecting a live WhatsApp number — the trial runs on the production API, not a sandbox.