Choosing Your Platform
There are three common approaches for resellers looking to sell digital gift cards:
| Platform | Time to Launch | Custom Control | Scalability |
|---|---|---|---|
| WooCommerce (WordPress) | 1โ2 days | Medium | Medium |
| Shopify | 1โ2 days | Medium | High |
| Custom backend | 1โ2 weeks | Full | Unlimited |
The right choice depends on your technical resources and long-term goals. This guide covers all three, with FoxReload API integration at the core.
Option A โ WooCommerce
Prerequisites
- WordPress + WooCommerce installed
- PHP 8.0+
- Your FoxReload API key
Step 1 โ Create Virtual Products
In WooCommerce, gift cards should be set up as "Virtual" and "Downloadable" products (no physical shipping). Create one product per denomination.
Step 2 โ Fulfill Orders via a Custom Hook
Add fulfillment logic to functions.php or a custom plugin:
<?php
add_action('woocommerce_order_status_completed', 'foxreload_fulfill_order');
function foxreload_fulfill_order($order_id) {
$order = wc_get_order($order_id);
foreach ($order->get_items() as $item) {
$product = $item->get_product();
$foxreload_id = $product->get_meta('foxreload_product_id');
if (!$foxreload_id) continue;
// Call FoxReload API
$response = wp_remote_post('https://api.foxreload.com/api/v1/orders', [
'headers' => [
'Authorization' => 'Bearer ' . get_option('foxreload_api_key'),
'Content-Type' => 'application/json',
'Idempotency-Key' => 'wc-order-' . $order_id
],
'body' => json_encode([
'product_id' => $foxreload_id,
'quantity' => $item->get_quantity(),
'external_order_id' => 'wc-' . $order_id
])
]);
$body = json_decode(wp_remote_retrieve_body($response), true);
if (!empty($body['codes'])) {
$code = $body['codes'][0]['code'];
// Save code as order meta
$order->update_meta_data('gift_card_code_' . $foxreload_id, $code);
$order->save();
// Add to order note (visible to customer in My Account)
$order->add_order_note(
"Gift card code delivered: {$code}",
true // customer_note = true
);
}
}
}
Step 3 โ Display Code in Order Confirmation Email
add_action('woocommerce_email_order_details', 'add_gift_code_to_email', 10, 4);
function add_gift_code_to_email($order, $sent_to_admin, $plain_text, $email) {
if ($email->id !== 'customer_completed_order') return;
foreach ($order->get_items() as $item) {
$product = $item->get_product();
$code = $order->get_meta('gift_card_code_' . $product->get_meta('foxreload_product_id'));
if ($code) {
echo "<p><strong>Your gift card code:</strong> <code>{$code}</code></p>";
}
}
}
Step 4 โ Schedule Price Sync
// Register cron event on plugin activation
register_activation_hook(__FILE__, function() {
wp_schedule_event(time(), 'hourly', 'foxreload_sync_prices');
});
add_action('foxreload_sync_prices', 'sync_foxreload_prices');
function sync_foxreload_prices() {
$response = wp_remote_get('https://api.foxreload.com/api/v1/catalog?category=google-play', [
'headers' => ['Authorization' => 'Bearer ' . get_option('foxreload_api_key')]
]);
$products = json_decode(wp_remote_retrieve_body($response), true)['products'];
foreach ($products as $p) {
$wc_products = wc_get_products(['meta_key' => 'foxreload_product_id', 'meta_value' => $p['id']]);
foreach ($wc_products as $wc_product) {
$retail = round($p['wholesale_price'] * 1.15, 2);
$wc_product->set_price($retail);
$wc_product->set_regular_price($retail);
$wc_product->save();
}
}
}
Option B โ Shopify
Shopify does not allow downloading custom server-side code, so fulfillment runs through a custom app or a serverless function.
Step 1 โ Create Products in Shopify Admin
Create gift card products in Shopify as digital products (disable shipping). Add a custom metafield foxreload_product_id to each variant.
Step 2 โ Shopify Webhook โ Your Fulfillment Service
Register a webhook in Shopify for orders/paid:
// Your fulfillment service (Node.js / Vercel function)
const { verifyShopifyWebhook } = require("./utils");
export default async function handler(req, res) {
// Verify Shopify webhook signature
const isValid = verifyShopifyWebhook(req.body, req.headers["x-shopify-hmac-sha256"]);
if (!isValid) return res.status(401).end();
const order = JSON.parse(req.body);
res.status(200).end(); // Acknowledge immediately
for (const item of order.line_items) {
const foxreloadId = item.properties.find(p => p.name === "foxreload_id")?.value;
if (!foxreloadId) continue;
const foxOrder = await placeFoxReloadOrder(foxreloadId, `shopify-${order.id}`);
const code = foxOrder.codes[0].code;
// Send fulfillment to Shopify with code as tracking info
await shopifyFulfill(order.id, item.id, code);
// Email customer via your transactional email service
await sendCodeEmail(order.email, code, item.title);
}
}
Step 3 โ Price Sync via Shopify Admin API
const Shopify = require("shopify-api-node");
const shopify = new Shopify({ shopName: "your-shop", apiKey, password });
async function syncPricesToShopify() {
const catalog = await fetchFoxReloadCatalog("google-play");
for (const product of catalog) {
const retailPrice = (product.wholesale_price * 1.15).toFixed(2);
const shopifyVariant = await findVariantByMetafield(product.id);
if (shopifyVariant) {
await shopify.productVariant.update(shopifyVariant.id, {
price: retailPrice
});
}
}
}
Option C โ Custom Backend
For full control, build your own backend. The integration is straightforward:
# FastAPI example
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
app = FastAPI()
class CheckoutRequest(BaseModel):
product_id: str
payment_method_id: str # Stripe payment method
@app.post("/checkout")
async def checkout(req: CheckoutRequest, user=Depends(get_current_user)):
product = await db.get_product(req.product_id)
# Charge customer
charge = await stripe_charge(
amount=product.retail_price_cents,
payment_method=req.payment_method_id,
description=product.name
)
# Place wholesale order
fox_order = await foxreload_place_order(
product_id=req.product_id,
external_order_id=charge.id
)
code = fox_order["codes"][0]["code"]
# Save and return
await db.save_order(user.id, req.product_id, code, charge.id)
return {"code": code, "order_id": charge.id}
Platform Comparison for Gift Card Resale
| Feature | WooCommerce | Shopify | Custom |
|---|---|---|---|
| Code display on-screen | Plugin required | Custom app | Built-in |
| Price auto-sync | Via cron hook | Via scheduled job | Native |
| Webhook support | Via plugin | Native | Native |
| Multi-currency | WooCommerce multilingual | Native | Custom |
| Scaling cost | Hosting | Monthly fee | Infrastructure |
Launch Checklist (All Platforms)
- FoxReload API key stored securely (not in source code)
- Test orders placed in sandbox before going live
- Price sync running on a schedule
- Code delivery tested end-to-end
- Customer email with code set up and tested
- Refund process defined for failed fulfillments
- Terms of service and region restrictions disclosed
See Also
- How to build a digital goods storefront for gift card resale
- How to auto-update Google Play Gift Card prices
- How to implement instant delivery for Google Play Gift Cards
Launch on any platform. FoxReload's REST API integrates with WooCommerce, Shopify, and custom backends โ pick your stack and start selling.

