Public documentation

BepPay eSIM API Documentation

Use an API key to read your balance, browse the catalog, purchase eSIMs and virtual numbers, and track order history. Keys are created in the partner dashboard. Only the eSIM plans endpoint works without a key; every other route requires a valid `pk_live_...` key. Production partner API requests should target `https://esim.beppay.com`. Top-ups go to the deposit address of a wallet when deposits are enabled and are handled manually otherwise.

Authentication

Send your key as `Authorization: Bearer pk_live_...` or `X-API-Key`. A key works only from the IP addresses in its allowlist, only for its scopes, and only when the account email is verified. Any failed check returns 401 with `Authentication required`.

API keys

Create and revoke keys in the dashboard under API Keys. The allowed IPs or CIDR ranges are required and cannot be edited later: create a new key to change them. A dashboard key gets all scopes: `esim`, `virtual_numbers` and `wallets_read`. You can keep up to 5 active keys. An API key cannot create or revoke keys.

Purchases are idempotent

Every purchase needs an `Idempotency-Key` header. A repeated request with the same key returns the result of the first one and charges nothing more. If a purchase times out or fails, repeat it with the same key. A new key starts a new purchase.

Top-ups

When deposits are enabled, get a wallet address from `/api/partner/wallets/addresses` and transfer to it: the balance is credited after confirmation. When they are disabled, that endpoint answers 503 and the balance is topped up manually.

Balance

Check your wallet balance. Requires the wallets_read scope.

GET/api/partner/balance

Get total balance across all partner wallets.

  • address is null while deposits are disabled (deposits_enabled is false), and until the address is first requested from /api/partner/wallets/addresses.
  • A purchase is debited from one wallet. That wallet alone must hold the full amount: balances are not combined.
Request
curl https://esim.beppay.com/api/partner/balance \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": {
    "total_balance_usd": "500.00",
    "deposits_enabled": false,
    "wallets": [
      {
        "id": 1,
        "balance": "500.00000000",
        "currency": "USDT_TRC20",
        "address": null
      },
      {
        "id": 2,
        "balance": "0.00000000",
        "currency": "USDT_ERC20",
        "address": null
      }
    ]
  }
}

Wallets and Top-ups

List wallets, get deposit addresses and track top-ups. Requires the wallets_read scope.

GET/api/partner/wallets

List your wallets with balances.

Request
curl https://esim.beppay.com/api/partner/wallets \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "currency": "USDT_TRC20",
      "balance": "500.00000000",
      "created_at": "2026-03-01T00:00:00.000Z"
    }
  ]
}
GET/api/partner/wallets/addresses

Get the deposit address of each wallet.

  • An address is created on the first call and stays the same afterwards.
  • Send only the currency and network of that wallet to its address. The balance is credited after the transfer is confirmed.
  • address is null for a wallet whose address could not be created. Call again later.
  • Status 503 with code deposits_maintenance means deposits are switched off.
  • Limit: 10 requests per minute per IP.
Request
curl https://esim.beppay.com/api/partner/wallets/addresses \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "currency": "USDT_TRC20",
      "address": "TXYZ1234567890abcdefghijklmnopqrst",
      "balance": "500.00000000"
    }
  ]
}
POST/api/partner/wallets/deposit

Create a payment order for a fixed top-up amount.

  • Header Idempotency-Key is required, in the same format as for purchases. Use a new value for each new top-up.
  • Body: amount from 1 to 10000 with at most two decimals, currency one of USDT_TRC20, USDT_ERC20, USDC_ERC20.
  • Open payment_url to pay. The wallet is credited after the payment is confirmed.
  • Status 202 means the order is not confirmed yet. Repeat the same request with the same Idempotency-Key.
  • Status 503 with code deposits_maintenance means deposits are switched off.
  • Limit: 5 requests per minute per IP.
Request
curl -X POST https://esim.beppay.com/api/partner/wallets/deposit \
  -H "Authorization: Bearer pk_live_your_key_here" \
  -H "Idempotency-Key: topup-2026-000045-usdt" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "100.00",
    "currency": "USDT_TRC20"
  }'
Response
{
  "success": true,
  "data": {
    "deposit_id": 12,
    "payment_url": "https://payments.example.com/order/9f1c2e7a",
    "beppay_order_uuid": "9f1c2e7a-3b4d-4c5e-8f60-1a2b3c4d5e6f",
    "expires_at": "2026-03-30T13:00:00Z",
    "amount": "100.00",
    "currency": "USDT_TRC20"
  }
}
GET/api/partner/wallets/deposit

Get top-up history, newest first.

  • Optional query: limit from 1 to 100 (default 50) and offset from 0.
  • total is the number of top-ups in this page, not in the whole history.
  • status is one of pending, confirming, completed, failed.
Request
curl "https://esim.beppay.com/api/partner/wallets/deposit?limit=50&offset=0" \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": 12,
      "wallet_id": 1,
      "user_id": 7,
      "amount": "100.00000000",
      "currency": "USDT_TRC20",
      "tx_hash": "44ad66d4...",
      "status": "completed",
      "beppay_order_uuid": "9f1c2e7a-3b4d-4c5e-8f60-1a2b3c4d5e6f",
      "beppay_deposit_id": null,
      "confirmed_at": "2026-03-30T12:20:00.000Z",
      "created_at": "2026-03-30T12:00:00.000Z",
      "updated_at": "2026-03-30T12:20:00.000Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}

eSIM Plans

Browse available eSIM plans. Works without a key; send your key to see the prices for your account.

GET/api/partner/esim/plans

List available eSIM plans.

  • Optional query: plan_type (country, regional or global) and search (matches the plan name and the included countries).
  • price is in USD. With your key it is the price for your account and equals the amount a purchase debits. Without a key it is the standard price.
  • A key that is sent but not accepted returns 401. The endpoint never answers a rejected key with another price.
  • data is the volume in GB, days is the validity period. image is a path on this host.
  • Limit: 60 requests per minute per IP.
Request
curl "https://esim.beppay.com/api/partner/esim/plans?plan_type=country&search=united%20states" \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": "fee467491b4555328b9a75e76066cbda",
      "plan_id": "fee467491b4555328b9a75e76066cbda",
      "name": "United States 5GB_20250318",
      "days": "15",
      "price": "3.87",
      "data": "5",
      "countries_included": "United States",
      "countryIso2": "US",
      "mcc": "310,311",
      "iso3": "USA",
      "operators": "AT&T USA,T-Mobile USA,Verizon USA",
      "image": "/flags/USA.png",
      "apn": "plus",
      "plan_type": "country",
      "is_visible": true
    }
  ],
  "total": 1
}

eSIM Purchase

Purchase eSIMs programmatically. Requires the esim scope.

POST/api/partner/esim/purchase

Purchase an eSIM using your internal partner balance.

  • Header Idempotency-Key is required: 16-128 characters from A-Z, a-z, 0-9, _ and -. Use a new value for each new purchase.
  • Body: plan_id is required, email is optional.
  • esim.img is the QR code as an image data URL. esim.qrcode is the LPA activation string for manual entry. esim.ios_tap_link opens the eSIM installer on an iPhone.
  • The esim object has exactly these four fields. img or ios_tap_link is null when it is not available; qrcode alone is enough to install the eSIM.
  • meta.amount_charged is the amount debited. data.plan.price_usd is the same amount as a number, and it matches the price the plans endpoint returns for your key.
  • Save img and qrcode: the orders endpoint does not return them. To read them again, repeat this request with the same Idempotency-Key.
  • Status 202 means the purchase is not finished: the body is { "status", "operation_id", "message" } and the amount stays reserved. Repeat the same request with the same Idempotency-Key until you get 200. Never retry with a new key.
  • Limit: 10 purchases per minute per IP.
Request
curl -X POST https://esim.beppay.com/api/partner/esim/purchase \
  -H "Authorization: Bearer pk_live_your_key_here" \
  -H "Idempotency-Key: order-2026-000123-esim" \
  -H "Content-Type: application/json" \
  -d '{
    "plan_id": "fee467491b4555328b9a75e76066cbda",
    "email": "customer@example.com"
  }'
Response
{
  "success": true,
  "data": {
    "esim": {
      "iccid": "8944501234567890123",
      "img": "data:image/png;base64,iVBORw0KGgo...",
      "qrcode": "LPA:1$smdp.example.com$ACTIVATION-CODE",
      "ios_tap_link": "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA:1$smdp.example.com$ACTIVATION-CODE"
    },
    "plan": {
      "id": "fee467491b4555328b9a75e76066cbda",
      "name": "United States 5GB_20250318",
      "price_usd": 3.87
    }
  },
  "meta": {
    "amount_charged": "3.87",
    "currency": "USDT_TRC20",
    "remaining_balance": "496.13"
  }
}

eSIM Orders

View eSIM order history. Requires the esim scope.

GET/api/partner/esim/orders

Get eSIM order history, newest first.

  • Optional query: limit from 1 to 100 (default 50) and offset from 0.
  • total is the number of orders in this page, not in the whole history.
Request
curl "https://esim.beppay.com/api/partner/esim/orders?limit=50&offset=0" \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "iccid": "8944501234567890123",
      "plan_id": "fee467491b4555328b9a75e76066cbda",
      "plan_name": "United States 5GB_20250318",
      "cost_usd": "3.87",
      "currency": "USDT_TRC20",
      "email": "customer@example.com",
      "status": "completed",
      "created_at": "2026-03-30T12:00:00.000Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}

eSIM Usage

Read the current state and data usage of one of your eSIMs. Read-only: it never changes the eSIM. Requires the esim scope.

GET/api/partner/esim/usage

Get the profile status, plan dates and data usage of one eSIM.

  • Query: exactly one of iccid (from the purchase response or the orders endpoint) or order_id (the id field from the orders endpoint). Only your own eSIMs are found; any other value returns 404.
  • Each call reads the current values; nothing is cached on our side. checked_at is the time of that read, in UTC. Network usage counters can lag behind real use, so a recent session may appear later.
  • profile_status is the eSIM profile state: not_installed (QR code not scanned yet), downloaded, installed, enabled (switched on in the device), disabled (switched off in the device), deleted (removed from the device), or unknown.
  • plan_activated_at is null until the plan starts. plan_expires_at is when the plan ends. Both are ISO 8601 in UTC.
  • data_total_mb, data_used_mb and data_remaining_mb are in megabytes. Each is null when it is not reported. data_total_mb is null for a plan without a fixed volume.
  • Installed but not used: profile_status is installed or enabled, and data_used_mb is 0.
  • last_network is the network where the eSIM was last seen (mcc, mnc, rat such as LTE), or null when it has not been seen yet.
  • Status 502 means the usage data could not be read right now. Retry later.
  • Limit: 60 requests per minute per IP.
Request
curl "https://esim.beppay.com/api/partner/esim/usage?order_id=1" \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": {
    "order_id": 1,
    "iccid": "8944501234567890123",
    "plan_id": "fee467491b4555328b9a75e76066cbda",
    "plan_name": "United States 5GB_20250318",
    "profile_status": "enabled",
    "plan_activated_at": "2026-03-30T14:05:00.000Z",
    "plan_expires_at": "2026-04-14T14:05:00.000Z",
    "data_total_mb": 5120,
    "data_used_mb": 1873,
    "data_remaining_mb": 3247,
    "last_network": {
      "seen_at": "2026-04-02T09:41:00.000Z",
      "mcc": "310",
      "mnc": "260",
      "rat": "LTE"
    },
    "checked_at": "2026-04-02T10:00:00.000Z"
  }
}

Virtual Numbers Catalog

Browse available virtual number countries and pricing tiers. These endpoints need your key.

GET/api/partner/virtual-numbers/countries

List available countries for virtual number purchase.

  • Limit: 60 requests per minute per IP.
Request
curl https://esim.beppay.com/api/partner/virtual-numbers/countries \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "code": "GB",
      "name": "United Kingdom"
    },
    {
      "code": "US",
      "name": "United States"
    }
  ],
  "total": 2
}
GET/api/partner/virtual-numbers/tiers

List available virtual number pricing tiers.

  • Limit: 60 requests per minute per IP.
Request
curl https://esim.beppay.com/api/partner/virtual-numbers/tiers \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": "1m",
      "name": "1 Month",
      "days": 30,
      "price_usd": 10
    },
    {
      "id": "1y",
      "name": "1 Year",
      "days": 365,
      "price_usd": 40
    }
  ],
  "total": 2
}

Virtual Numbers Purchase

Purchase virtual numbers programmatically. Requires the virtual_numbers scope.

POST/api/partner/virtual-numbers/purchase

Purchase a virtual number using your internal partner balance.

  • Header Idempotency-Key is required: 16-128 characters from A-Z, a-z, 0-9, _ and -. Use a new value for each new purchase.
  • Body: country_code and tier_id are required, country_name is optional.
  • Status 202 means the purchase is not finished: the body is { "status", "operation_id", "message" } and the amount stays reserved. Repeat the same request with the same Idempotency-Key until you get 200. Never retry with a new key.
  • Limit: 10 purchases per minute per IP.
Request
curl -X POST https://esim.beppay.com/api/partner/virtual-numbers/purchase \
  -H "Authorization: Bearer pk_live_your_key_here" \
  -H "Idempotency-Key: order-2026-000124-number" \
  -H "Content-Type: application/json" \
  -d '{
    "country_code": "US",
    "country_name": "United States",
    "tier_id": "1m"
  }'
Response
{
  "success": true,
  "data": {
    "phone_number": "+12025550123",
    "country_code": "US",
    "country_name": "United States",
    "tier": {
      "id": "1m",
      "name": "1 Month",
      "days": 30,
      "price_usd": 10
    },
    "expires_at": "2026-05-08T10:00:00.000Z"
  },
  "meta": {
    "amount_charged": "10.00",
    "currency": "USDT_TRC20",
    "remaining_balance": "490.00"
  }
}

Virtual Number Orders

View virtual number order history. Requires the virtual_numbers scope.

GET/api/partner/virtual-numbers/orders

Get virtual number order history, newest first.

  • Optional query: limit from 1 to 100 (default 50) and offset from 0.
  • total is the number of orders in this page, not in the whole history.
Request
curl "https://esim.beppay.com/api/partner/virtual-numbers/orders?limit=50&offset=0" \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "phone_number": "+12025550123",
      "country_code": "US",
      "country_name": "United States",
      "tier_id": "1m",
      "tier_name": "1 Month",
      "duration_days": 30,
      "cost_usd": "10.00",
      "currency": "USDT_TRC20",
      "status": "active",
      "autorenew": false,
      "expires_at": "2026-05-08T10:00:00.000Z",
      "created_at": "2026-04-08T10:00:00.000Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}

Virtual Number SMS

Retrieve inbound SMS for partner-owned virtual numbers. Requires the virtual_numbers scope.

GET/api/partner/virtual-numbers/sms

Get SMS messages for a virtual number that belongs to your partner account.

  • Query: phone_number is required (encode the plus sign as %2B), offset is optional, from 0 to 1000.
  • Status 404 means the number is not on your account.
  • Limit: 60 requests per minute per IP.
Request
curl "https://esim.beppay.com/api/partner/virtual-numbers/sms?phone_number=%2B12025550123&offset=0" \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "created_at": "2026-04-08 10:14:26",
      "from": "Telegram",
      "to_phone": "12025550123",
      "message": "Your confirmation code is 482913"
    }
  ],
  "meta": {
    "phone_number": "+12025550123",
    "offset": 0,
    "count": 1
  }
}

Status codes

An error body is a JSON object with a single `error` message. There are no machine-readable error codes: branch on the HTTP status.

StatusMeaning
202Purchase accepted but not finished. Repeat the same request with the same Idempotency-Key.
400Invalid JSON, body field, query parameter or Idempotency-Key header.
401Key is missing, invalid, expired, lacks the scope for this endpoint, is used from an IP outside its allowlist, or the account email is not verified. The response does not say which.
402Insufficient balance for the purchase.
404The virtual number (SMS endpoint) or the eSIM (usage endpoint) is not on your account.
409Idempotency-Key was already used with a different request body.
429Rate limit reached. Wait for the seconds in the Retry-After header.
500Request failed. For a purchase the result is unknown, so repeat it with the same Idempotency-Key. An unknown plan_id or tier_id also returns 500.
502The data could not be read right now (SMS and eSIM usage endpoints). Retry later.
503Deposits are switched off (code deposits_maintenance on the wallet endpoints).