84trust / 100
Invoice Pay
by Bitrefill in Markets & finance
x402 APIPassing, checked 5 h ago
Pay a Bitrefill invoice in USDC via x402 to buy gift cards, eSIMs & mobile top-ups across 180+ countries.
POST https://api.bitrefill.com/x402/invoice/pay
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 74 ms typical, 74 ms slowest 5%
- Last check
- 5 h ago
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://api.bitrefill.com/x402/invoice/pay" \
-H "content-type: application/json" \
-d '{"invoice_id":"c2b27180-610e-4132-af77-ad42fc0ac444"}'import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.bitrefill.com%2Fx402%2Finvoice%2Fpay
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"
}Example output
{
"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"
}
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 5 h ago | Passed | 402 | 74 ms | $1,000.00 |