Skip to content
Fourohtwo

api.bitrefill.com/x402/invoice/pay

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

BaseArbitrumPolygonSolanaAnswering
POSThttps://api.bitrefill.com/x402/invoice/pay

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://api.bitrefill.com/x402/invoice/pay", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"invoice_id":"c2b27180-610e-4132-af77-ad42fc0ac444"}),
});
console.log(await res.json());

Example input

{
  "invoice_id": "c2b27180-610e-4132-af77-ad42fc0ac444"
}

More from BitrefillProvider status