{"version":1,"resources":["https://stablegiftcards.dev/api/search","https://stablegiftcards.dev/api/product","https://stablegiftcards.dev/api/buy","https://stablegiftcards.dev/api/invoice"],"description":"Search and buy Bitrefill gift cards, top-ups, and eSIMs. 1,500+ brands, 180+ countries.","instructions":"StableGiftCards — Buy gift cards, top-ups, and eSIMs from 1,500+ brands in 180+ countries.\n\n## Flow\n\n1. POST /api/search — Find products by name, country, or category (SIWX, free)\n2. POST /api/product — Get denominations and pricing (SIWX, free)\n3. POST /api/buy — Purchase. Pays via x402 (dynamic price = product cost in USDC). Returns orders; codes are included when delivery completes within the response window, otherwise status is \"pending\".\n4. POST /api/invoice — Poll for delivery status and redemption codes (SIWX, free)\n\n## Search\n\nPOST /api/search\nBody: { \"query\": \"Netflix\", \"country\": \"US\" }\nOptional: product_type (\"giftcard\" or \"esim\"), category, in_stock, page, per_page (max 500)\nCountry must be uppercase ISO Alpha-2 (US, IT, BR).\n\n## Product Details\n\nPOST /api/product\nBody: { \"product_id\": \"netflix-usa\" }\nReturns packages array with denominations. Use the \"value\" field as package_id when buying.\n\n## Buy\n\nPOST /api/buy\nBody: { \"cart_items\": [{ \"product_id\": \"netflix-usa\", \"package_id\": \"30\" }] }\nx402-protected. First call returns 402 with the USDC price. Pay via x402 to complete.\nOn success returns invoice_id, tx_hash, and orders. Orders may have status \"pending\" if Bitrefill hasn't delivered yet — in that case, poll POST /api/invoice with the invoice_id to retrieve codes.\nUse a generous client timeout (60s+) since the response waits briefly for fast deliveries. Do not retry on client-side timeout: the x402 payment has already been captured and retrying will double-charge.\nMax 15 items per order.\n\n## Invoice\n\nPOST /api/invoice\nBody: { \"invoice_id\": \"<uuid>\" }\nReturns order status and redemption codes once fulfilled."}