Bitrefill · Invoice PAY

by Bitrefill

POSTBaseSolanaArbitrumPolygon

$1,000

per call · USD Coin on Base

Pay a Bitrefill invoice in USDC via x402 to buy gift cards, eSIMs & mobile top-ups across 180+ countries.

Endpoint

POST https://api.bitrefill.com/x402/invoice/pay

32

Calls / 30d

7

Unique payers / 30d

Sep 10

Last called

upto

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://api.bitrefill.com/x402/invoice/pay", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "invoice_id": "c2b27180-610e-4132-af77-ad42fc0ac444"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://api.bitrefill.com/x402/invoice/pay" \
  -H "Content-Type: application/json" \
  -d '{"invoice_id":"c2b27180-610e-4132-af77-ad42fc0ac444"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "accepted": true,
  "message": "Payment accepted; poll invoice/status for fulfillment outcome and redemption codes.",
  "next_step": {
    "url": "/x402/invoice/status?invoice_id=c2b27180-610e-4132-af77-ad42fc0ac444"
  }
}

Payment details

Pay to0x480cd46e6fade651a0437deadda53d5c8e7d846a
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana, Arbitrum, Polygon
Schemesupto

Is this your API?

Pin it to the top of Other and the homepage with a featured placement.

Get featured →

More from Bitrefill & similar services