Bitrefill API Documentation
The Bitrefill API lets you programmatically purchase gift cards, mobile top-ups, and eSIMs. Whether you're building a personal automation, integrating gift cards into your platform, or earning commissions as an affiliate, the API provides everything you need.
What You Can Do
With the Bitrefill API, you can:
- Browse products — Search and filter gift cards, eSIMs, and mobile top-ups across 170+ countries
- Create invoices — Purchase one or multiple products in a single transaction
- Pay with crypto or balance — Use Bitcoin, Lightning, Ethereum, USDC, USDT, or your account balance
- Track orders — Monitor payment status and retrieve redemption codes
- Manage eSIMs — Purchase and top-up eSIMs with data bundles
API Versions
Bitrefill offers different API access levels depending on your use case. This guide helps you choose the right one.
Quick Decision
| I want to... | You need |
|---|---|
| Build a personal project or automation | Personal API |
| Integrate gift cards into my platform | Business API |
| Resell Bitrefill products at scale | Business API |
| Earn commissions on referrals | Affiliate API |
Personal API
For individual developers and personal projects.
The Personal API lets you access Bitrefill programmatically using a Bearer token from your personal account. It's ideal for:
- Personal automations
- Side projects
- Learning the API
- Small-scale purchases
How to Get Access
- Sign in to bitrefill.com
- Go to Account > Developers
- Generate an API key
Authentication
const API_KEY = process.env.BITREFILL_API_KEY;
const response = await fetch(`${BASE_URL}/ping`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});Make your first API call in 5 minutes.
Business API
For B2B integrators, platforms, and resellers.
The Business API provides full access to Bitrefill's product catalog and additional features for high-volume use cases:
- Full product catalog including test products
- BRGC (Bitrefill Gift Card) batch creation
- Account deposits
- Dedicated support
How to Get Access
Contact the Bitrefill team to set up a Business account:
- Apply to the Bitrefill Partner Program
- Receive your API ID and API Secret
- Start integrating
Authentication
const API_ID = process.env.BITREFILL_API_ID;
const API_SECRET = process.env.BITREFILL_API_SECRET;
const token = Buffer.from(`${API_ID}:${API_SECRET}`).toString('base64');
const response = await fetch(`${BASE_URL}/ping`, {
headers: { 'Authorization': `Basic ${token}` }
});Complete your first purchase flow.
Affiliate API
For partners earning commissions on referrals.
The Affiliate API is a variant of the Business API for partners in the Bitrefill affiliate program. It includes everything in the Business API plus:
- Commission tracking endpoint
- Referral-filtered order and invoice views
- Revenue reporting
How to Get Access
- Apply to the Bitrefill Affiliate Program
- Once approved, receive your API credentials
- Start tracking commissions via API
Key Difference
When you query orders and invoices, results are filtered by your referrer_id instead of user_id. This means you see purchases made by users you referred, not just your own purchases.
Start tracking your commissions.
Feature Comparison
| Feature | Personal | Business | Affiliate |
|---|---|---|---|
| Authentication | Bearer token | Basic auth | Basic auth |
| Product access | Standard | Full + test products | Full + test products |
| BRGC batches | No | Yes | Yes |
| Account deposits | No | Yes | Yes |
| Webhooks | Yes | Yes | Yes |
| Commission tracking | No | No | Yes |
| Invoice filtering | By user | By user | By referrer |
| Rate limits | Standard | Standard | Standard |
| Support | Community | Dedicated | Dedicated |
Still Not Sure?
I just want to buy gift cards for myself
Use the Personal API. It's self-service and gives you everything you need for personal purchases.
I'm building an app that sells gift cards
Use the Business API. You'll need the full product catalog, test products for development, and possibly BRGC batches for bulk gift cards.
I run a blog/site and want to earn from referrals
Apply for the Affiliate Program. You'll earn commissions when users purchase through your referral links, and can track everything via the Affiliate API.
I'm a crypto exchange or wallet
Use the Business API. Contact the Bitrefill team to discuss your integration needs — we have experience with exchanges, wallets, and payment processors.
Updated 7 days ago