# Bitrefill x402 Invoice Create

> Bitrefill x402 Invoice Create is a paid API for AI agents from api.bitrefill.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-13).

Creates a USDC payment invoice to purchase gift cards, eSIMs, mobile top-ups, or prepaid cards from 10,000+ brands across 180+ countries via the x402 protocol

## Facts

- Endpoint: POST https://api.bitrefill.com/x402/invoice/create?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitrefill-x402-invoice-create-b69144b9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xs4UmkkRYROyLIRxNIueI

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability bitrefill-x402-invoice-create-b69144b9 -d '<json body>'
```

Example prompt: Buy me a $25 Amazon US gift card using USDC — I want to use product slug 'amazon-us' with package value '25', no recipient needed.

## When to prefer this

Use this endpoint when an AI agent needs to programmatically purchase gift cards, eSIMs, or mobile top-ups using USDC stablecoins without requiring a Bitrefill account or API key. It is ideal for crypto-native workflows, agent-driven gifting, or on-chain payment automation where the wallet itself is the identity. Prefer over traditional gift card APIs when the buyer holds USDC on Base or Solana and wants permissionless access to 10,000+ brands globally.

## Known failure modes

- Invalid product_id returns an error indicating the slug does not exist
- Missing required refill_input when recipient_type is not 'none' causes validation failure
- Invoice expires after 15 minutes if payment is not submitted in time
- Unsupported package_value denomination returns an error
- Exceeding maxItems of 15 in the items array returns a validation error
- Insufficient USDC balance or wrong network may cause payment failure at the pay step

## How this service works

Create a price-locked USDC invoice for one or more gift cards, eSIMs, or mobile top-ups.

## Output

Returns a JSON object with an invoice_id (UUID), price in USD and USDC (integer micro-units), a list of supported blockchain networks (e.g. Base, Solana), a next_step URL and body for completing payment, and an expiration window of 15 minutes to complete the payment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "product_id",
     "package_value"
    ],
    "properties": {
     "product_id": {
      "type": "string",
      "description": "Product slug from a search result"
     },
     "refill_input": {
      "type": "string",
      "description": "Recipient identifier (phone/email/account) — required when the product's recipient_type is not \"none\""
     },
     "package_value": {
      "type": "string",
      "description": "The denomination from /x402/products/detail \"package_value\" (e.g. \"25\")"
     }
    }
   },
   "maxItems": 15,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "networks": [
   "eip155:8453",
   "solana:mainnet"
  ],
  "next_step": {
   "url": "/x402/invoice/pay",
   "body": {
    "invoice_id": "c2b27180-610e-4132-af77-ad42fc0ac444"
   }
  },
  "price_usd": 25,
  "invoice_id": "c2b27180-610e-4132-af77-ad42fc0ac444",
  "price_usdc": "25000000",
  "expires_in_minutes": 15
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitrefill-x402-invoice-create-b69144b9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.bitrefill.com](https://www.zero.xyz/host/api.bitrefill.com/llms.txt)
