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 automationPersonal API
Integrate gift cards into my platformBusiness API
Resell Bitrefill products at scaleBusiness API
Earn commissions on referralsAffiliate 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

  1. Sign in to bitrefill.com
  2. Go to Account > Developers
  3. 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}` }
});
Quickstart

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:

  1. Apply to the Bitrefill Partner Program
  2. Receive your API ID and API Secret
  3. 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}` }
});
Quickstart

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

  1. Apply to the Bitrefill Affiliate Program
  2. Once approved, receive your API credentials
  3. 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.

Quickstart

Start tracking your commissions.

Feature Comparison

FeaturePersonalBusinessAffiliate
AuthenticationBearer tokenBasic authBasic auth
Product accessStandardFull + test productsFull + test products
BRGC batchesNoYesYes
Account depositsNoYesYes
WebhooksYesYesYes
Commission trackingNoNoYes
Invoice filteringBy userBy userBy referrer
Rate limitsStandardStandardStandard
SupportCommunityDedicatedDedicated

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.