The Problem With Manual Fulfillment
At 20โ30 orders per day, manually copying codes from a supplier panel and pasting them into customer emails is manageable. At 100+ orders, it breaks down: delays, paste errors, codes sent to the wrong buyer, and staff time spent on zero-value work.
API integration solves this entirely. Once connected, your storefront requests a code from the supplier the moment a customer pays, and the code appears in the customer's order confirmation โ no human in the loop.
How a Typical Gift Card API Works
Most wholesale digital goods suppliers expose a REST API with three core endpoints:
- Check balance / product availability โ confirm a SKU is in stock before charging the customer
- Place order โ request one or more codes for a specific product ID
- Get order result โ retrieve the code(s) once issued
The flow in practice:
Customer pays โ Your store calls /order โ Supplier returns code โ Store shows code to customer
End-to-end latency is typically 1โ8 seconds when the supplier has codes in stock.
Key API Integration Points
Authentication
Supplier APIs use API key authentication (passed as a header or query parameter) or OAuth2. Store your key in an environment variable, never in source code.
Product IDs
Each SKU โ Google Play $10 USA, Google Play โบ100 Turkey, etc. โ has a unique product ID in the supplier's system. Pull the product catalog endpoint first to map your store's SKUs to supplier IDs.
Error Handling
You must handle at minimum:
| HTTP Status | Meaning | Action |
|---|---|---|
| 200 | Success | Deliver code to customer |
| 400 | Bad request (wrong SKU, bad params) | Log and alert |
| 402 | Insufficient balance | Top up supplier account |
| 503 | Supplier temporarily unavailable | Retry with exponential backoff |
Do not show raw API errors to customers. Map them to friendly messages and trigger internal alerts.
Idempotency
If your server crashes after sending an order request but before receiving the response, you risk paying for a code you never delivered. Use idempotency keys: send a unique order reference with each request, and query order status on restart to check if the order already completed.
Practical Implementation Checklist
Before going live with automated delivery:
- Map all supplier product IDs to your store SKUs
- Test with a sandbox/test environment if the supplier provides one
- Implement stock-check call before accepting payment (or handle 402 gracefully)
- Set up retry logic for transient failures (max 3 retries, 2sโ4sโ8s backoff)
- Log every API request and response for debugging
- Set up alerting for error rate spikes (e.g., >5% errors in 5 minutes)
- Test idempotency: manually kill the process mid-order and verify no duplicate charge
- Load-test with your expected peak order volume
Platforms With Native Integrations
Several popular digital goods storefronts support supplier API plugins out of the box:
- Sellix โ supports custom API product sources
- Shopify โ via custom app or third-party fulfillment apps
- WooCommerce โ via custom plugin (PHP) or webhook-based fulfillment
- EasyDigitalDownloads โ webhook + cron-based delivery scripts
If your platform does not have a native integration, a simple fulfillment webhook triggered on order payment is enough. The webhook calls the supplier API and updates the order with the delivered code.
Balancing Automation With Stock Monitoring
Automation does not remove the need to monitor stock. Your API calls will fail with 402 (out of stock) if the supplier runs low on a specific SKU. Set up:
- A daily balance check alert if supplier account balance drops below a threshold
- A per-SKU stock level alert (via the catalog endpoint) for high-velocity items
- A fallback message to the customer if a code cannot be delivered within 60 seconds
FoxReload's API for Resellers
FoxReload provides a documented REST API covering all Google Play regions and denominations. Resellers get an API key on registration, test credentials for integration work, and access to a product catalog endpoint with live stock levels. Support for integration questions is available via the reseller dashboard.
Start your integration at foxreload.com/google-play.

