v1

latestOpenAPI 3.0.02026-07-24231140.6 KB
Invoices

Create a new eSIM invoice.

post/esims

Request body

payment_methodstring

Supported methods: 'balance', 'bitcoin', 'lightning', 'ethereum', 'usdc_base', 'eth_base', 'usdt_erc20', 'usdc_erc20', 'usdt_trc20', 'usdc_polygon', 'usdt_polygon', 'usdc_arbitrum', 'usdt_arbitrum', 'eth_arbitrum', 'usdc_solana', 'usdt_solana', 'solana', 'usdt_lightning', 'dogecoin', 'dash', 'litecoin', 'ton', 'usdt_ton'.

emailstring

Email to send the receipt to.

send_emailboolean

If we should send an email to the provided email with the receipt. (Default: false)

auto_payboolean

If the invoice should be paid right away. Only valid when payment_method is 'balance' (Default: false)

Example request

{
  "products": [
    {
      "product_id": "test-esim",
      "value": "1GB, 7 Days",
      "quantity": 1
    }
  ],
  "auto_pay": false,
  "payment_method": "balance"
}

Response

Success

Example response

{
  "meta": {
    "products": [
      {
        "product_id": "test-esim",
        "value": "1GB, 7 Days",
        "quantity": 1
      }
    ],
    "payment_method": "balance",
    "_endpoint": "/esims"
  },
  "data": {
    "id": "c2b27180-610e-4132-af77-ad42fc0ac444",
    "created_time": "2021-10-04T17:12:02.142Z",
    "completed_time": "2021-10-04T17:12:11.990Z",
    "status": "not_delivered",
    "user": {
      "id": "613b62204ef8b621bdb47539",
      "email": "test@bitrefill.com"
    },
    "payment": {
      "method": "balance",
      "address": "bc1qthrlhrdtk8vv7p25cmwat87kg7ezfjglrx5xyr",
      "currency": "USD",
      "price": 10,
      "status": "unpaid",
      "commission": 0.0001
    },
    "orders": [
      {
        "id": "615b35e2f616a8092ee45aff",
        "status": "created",
        "product": {
          "id": "test-gift-card-code",
          "name": "Test Gift Card Code",
          "value": "10",
          "currency": "USD",
          "image": "https://res.cloudinary.com/bitrefill/d_operator.png/this_is_a_test",
          "_href": "https://api-bitrefill.com/2/products/test-gift-card-code"
        },
        "created_time": "2021-10-04T17:12:02.101Z",
        "delivered_time": "2021-10-04T17:12:11.990Z"
      }
    ]
  }
}