$0.002
per call · USD Coin on Base
Create a price-locked USDC invoice for one or more gift cards, eSIMs, or mobile top-ups.
Endpoint
POST https://api.bitrefill.com/x402/invoice/create55
Calls / 30d
5
Unique payers / 30d
Sep 10
Last called
exact
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/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"items": [
{
"package_value": "25",
"product_id": "amazon-us"
}
]
}),
});
const data = await res.json();cURL
curl -X POST \
"https://api.bitrefill.com/x402/invoice/create" \
-H "Content-Type: application/json" \
-d '{"items":[{"package_value":"25","product_id":"amazon-us"}]}' \
-H "X-PAYMENT: <signed x402 payment>"Example response
{
"expires_in_minutes": 15,
"invoice_id": "c2b27180-610e-4132-af77-ad42fc0ac444",
"networks": [
"eip155:8453",
"solana:mainnet"
],
"next_step": {
"body": {
"invoice_id": "c2b27180-610e-4132-af77-ad42fc0ac444"
},
"url": "/x402/invoice/pay"
},
"price_usd": 25,
"price_usdc": "25000000"
}Payment details
Pay to
0x480cd46e6fade651a0437deadda53d5c8e7d846aAsset
USD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913NetworksBase, Solana, Arbitrum, Polygon
Schemesexact
Is this your API?
Pin it to the top of Media & Generation and the homepage with a featured placement.
More from Bitrefill & similar services
Bitrefill · Gift Cards Search
api.bitrefill.com
Search 10,000+ gift card & voucher brands across 180+ countries by name and country. Pay in USDC via x402, no account.
GETBaseSearch & Web
$0.002 / call53 calls / 30d
Bitrefill · Invoice PAY
api.bitrefill.com
Pay a Bitrefill invoice in USDC via x402 to buy gift cards, eSIMs & mobile top-ups across 180+ countries.
POSTBaseOther
$1,000 / call32 calls / 30d
Bitrefill · Esims Search
api.bitrefill.com
Search prepaid eSIM data plans for 180+ countries and regions. Pay in USDC via x402, no account.
GETBaseSearch & Web
$0.002 / call27 calls / 30d