---
updatedAt: 2026-03-26T15:27:22.000Z
agentTools:
  projectIndex: https://docs.bitrefill.com/llms.txt
---

# 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](#personal-api)   |
| Integrate gift cards into my platform  | [Business API](#business-api)   |
| Resell Bitrefill products at scale     | [Business API](#business-api)   |
| Earn commissions on referrals          | [Affiliate API](#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

1. Sign in to <Anchor label="bitrefill.com" target="_blank" href="https://www.bitrefill.com">bitrefill.com</Anchor>
2. Go to <Anchor label="Account > Developers" target="_blank" href="https://www.bitrefill.com/account/developers">Account > Developers</Anchor>
3. Generate an API key

### Authentication

```javascript
const API_KEY = process.env.BITREFILL_API_KEY;

const response = await fetch(`${BASE_URL}/ping`, {
  headers: { 'Authorization': `Bearer ${API_KEY}` }
});
```

<Card title="Quickstart" href="/docs/quickstart-2" icon="fa-rocket">
  Make your first API call in 5 minutes.
</Card>

## 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 <Anchor label="Bitrefill Partner Program" target="_blank" href="https://www.bitrefill.com/integrate">Bitrefill Partner Program</Anchor>
2. Receive your API ID and API Secret
3. Start integrating

### Authentication

```javascript
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}` }
});
```

<Card title="Quickstart" href="/docs/quickstart-2" icon="fa-rocket">
  Complete your first purchase flow.
</Card>

## 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 <Anchor label="Bitrefill Affiliate Program" target="_blank" href="https://www.bitrefill.com/affiliate">Bitrefill Affiliate Program</Anchor>
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.

<Card title="Quickstart" href="/docs/getting-started/quickstart" icon="fa-rocket">
  Start tracking your commissions.
</Card>

## 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?

<Accordion title="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.
</Accordion>

<Accordion title="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.
</Accordion>

<Accordion title="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.
</Accordion>

<Accordion title="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.
</Accordion>