Buy a product over x402 in one call
The x402 rail: order creation, payment and delivery in a single request, repeated twice. Send the createOrder body with no payment header and the response is 402 carrying the x402 PaymentRequired document — in the PAYMENT-REQUIRED response header, which is the canonical v2 location, and mirrored in the body — with accepts[0].amount holding the exact atomic USDC amount for that item, plus an order block. Sign it and repeat the identical request with the PAYMENT-SIGNATURE header: the payment is verified and settled, then the order is fulfilled. Send an Idempotency-Key to make retries safe — without one it is derived from the request body, so an identical repeat resolves to the same order rather than buying twice. The settlement receipt comes back in PAYMENT-RESPONSE. This endpoint speaks x402 v2 by default and x402 v1 for clients that need it: send the v1 payload in X-PAYMENT, or ask for a v1 quote with X-PAYMENT-VERSION: 1 (or ?x402_version=1); v1 names the chain "base", puts the amount in accepts[].maxAmountRequired and returns its receipt in X-PAYMENT-RESPONSE. Calling it with no purchase named at all (empty body, or a bare GET) is answered with a 402 quoting the rail's floor and no order block — that is the probe form, not a buyable quote; name a product to get a real price.
Request
- Base URL: https://blinkcodes.com
- URL: https://blinkcodes.com/api/v1/buy
- Auth: none declared
Headers
Base64 JSON x402 v2 PaymentPayload. Absent on the quoting call.
Base64 JSON x402 v1 PaymentPayload, for clients that do not speak v2.
Ask for a quote in a specific protocol version. Defaults to 2.
Request body
Response
Paid and fulfilled — delivery carries the code, esim or phone
Changes
No recorded changes to this operation across all 1 revision of this API.