Public documentation

BepPay Partner API Documentation

Use API keys to manage balances, issue keys, purchase eSIMs, and track orders. The plans endpoint is public, while most other partner routes require a valid `pk_live_...` key. Wallet addresses are intentionally hidden and balance top-ups are handled manually.

Authentication

Use `Authorization: Bearer pk_live_...` or `X-API-Key` for partner API requests.

Plans are public

`/api/partner/esim/plans` is accessible without authentication.

Top-ups are manual

Deposit addresses are disabled. Internal balance is topped up manually.

Authentication

Session-based authentication for the partner dashboard.

GET/api/auth/me

Get current authenticated partner user from the session cookie.

Request
curl http://localhost:3001/api/auth/me \
  -H "Cookie: access_token=your_session_cookie_here"
Response
{
  "success": true,
  "data": {
    "id": 123,
    "email": "partner@example.com",
    "created_at": "2026-03-30T12:00:00.000Z",
    "updated_at": "2026-03-30T12:00:00.000Z"
  }
}

API Keys

Manage your API keys programmatically.

GET/api/partner/keys

List all API keys.

Request
curl http://localhost:3001/api/partner/keys \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Production Key",
      "key_prefix": "pk_live_abc",
      "is_active": true,
      "last_used_at": "2026-03-30T12:00:00Z",
      "created_at": "2026-03-01T00:00:00Z"
    }
  ]
}
POST/api/partner/keys

Create a new API key.

Request
curl -X POST http://localhost:3001/api/partner/keys \
  -H "Authorization: Bearer pk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"New Key"}'
Response
{
  "success": true,
  "data": {
    "api_key": "pk_live_abc123...",
    "key_prefix": "pk_live_abc",
    "created_at": "2026-03-30T12:00:00Z"
  }
}
DELETE/api/partner/keys?id=1

Revoke an API key.

Request
curl -X DELETE "http://localhost:3001/api/partner/keys?id=1" \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "message": "Key revoked successfully"
}

Balance

Check your wallet balance. Deposit addresses are not exposed.

GET/api/partner/balance

Get total balance across all partner wallets.

Request
curl http://localhost:3001/api/partner/balance \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": {
    "total_balance_usd": "500.00",
    "wallets": [
      {
        "id": 1,
        "balance": "500.00",
        "currency": "USDT_TRC20"
      }
    ]
  }
}

eSIM Plans

Browse available eSIM plans. This endpoint is public.

GET/api/partner/esim/plans

List all available eSIM plans.

Request
curl http://localhost:3001/api/partner/esim/plans
Response
{
  "success": true,
  "data": [
    {
      "id": "867924fdaf913e7fe11434972587449d",
      "plan_id": "867924fdaf913e7fe11434972587449d",
      "name": "USA 5GB 30 Days",
      "days": "30",
      "price": "25.00",
      "data": "5GB",
      "countries_included": "United States",
      "countryIso2": "US",
      "plan_type": "country",
      "is_visible": true
    }
  ],
  "total": 1520
}

eSIM Purchase

Purchase eSIMs programmatically.

POST/api/partner/esim/purchase

Purchase an eSIM using your internal partner balance.

Request
curl -X POST http://localhost:3001/api/partner/esim/purchase \
  -H "Authorization: Bearer pk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "plan_id": "867924fdaf913e7fe11434972587449d",
    "email": "customer@example.com"
  }'
Response
{
  "success": true,
  "data": {
    "esim": {
      "iccid": "8944501234567890123",
      "qr_code": "data:image/png;base64,...",
      "activation_code": "LPA:1$8944501234567890123"
    },
    "plan": {
      "id": "867924fdaf913e7fe11434972587449d",
      "name": "USA 5GB 30 Days",
      "price_usd": 25
    }
  },
  "meta": {
    "amount_charged": "25.00",
    "currency": "USDT_TRC20",
    "remaining_balance": "475.00"
  }
}

Orders

View order history.

GET/api/partner/esim/orders

Get eSIM order history.

Request
curl http://localhost:3001/api/partner/esim/orders \
  -H "Authorization: Bearer pk_live_your_key_here"
Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "iccid": "8944501234567890123",
      "plan_id": "867924fdaf913e7fe11434972587449d",
      "plan_name": "USA 5GB 30 Days",
      "cost_usd": "25.00",
      "currency": "USDT_TRC20",
      "email": "customer@example.com",
      "created_at": "2026-03-30T12:00:00Z",
      "status": "completed"
    }
  ],
  "total": 1
}