{"uid":"cap_xs4UmkkRYROyLIRxNIueI","slug":"bitrefill-x402-invoice-create-b69144b9","name":"Bitrefill x402 Invoice Create","description":"Create a price-locked USDC invoice for one or more gift cards, eSIMs, or mobile top-ups.","url":"https://api.bitrefill.com/x402/invoice/create?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":{"p10Cents":"0.2000","medianCents":"0.2000","p90Cents":"0.2000","minCents":"0.2000","maxCents":"0.2000","p95Cents":"0.2000","sampleCount":1,"varies":false,"failureChargeRate":1},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PSkrVE3xBuh8_CJ3HJAUi","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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","exampleAgentPrompt":"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.","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":2,"lastUsedAt":"2026-07-17T23:48:03.612Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T06:42:08.195Z","isFirstParty":false,"canonicalSlug":"bitrefill-x402-invoice-create-b69144b9"}