Skip to content
Checkout: public page
GET/v0/checkout/{invoiceId}/agent

Pay an invoice over standard x402

The same resource as POST …/agent, for standard x402 clients, which GET a resource first (SPEC-checkout §14). With no payment header it answers 402 with the v2 PAYMENT-REQUIRED header (base64 JSON) listing the exact requirements: USDC on Base or Solana, to the merchant’s address or a deposit address that settles in the merchant’s asset. The JSON body is the same as the POST’s, with the v1 exact entries first.

Retry with PAYMENT-SIGNATURE (v2) or X-PAYMENT (v1) and the payment is verified and settled through the facilitator: 200 with PAYMENT-RESPONSE and a receipt to poll. Add ?payer=<address> to be offered routed requirements, whose refunds go back to that address. A paid invoice answers with its receipt; an expired or cancelled one with 410.

The invoice’s client secret, in the x-client-secret header. It reaches this one invoice’s public endpoints and nothing else, and expires with the invoice.

  • invoiceIdRequired · path
  • payerOptional · query

    The paying wallet. Unlocks routed requirements, whose refunds go back to it

  • 200Paid: the receipt (and PAYMENT-RESPONSE when this request paid it)
  • 402Payment required: PAYMENT-REQUIRED header, and the invoice and what it accepts
  • 410The invoice expired or was cancelled
curl
curl https://api.intents.fi/v0/checkout/inv_3QkR7mVt9zLpXdB2hJn6Yw/agent \
-H 'x-client-secret: $CLIENT_SECRET'
TypeScript
const response = await fetch("https://api.intents.fi/v0/checkout/inv_3QkR7mVt9zLpXdB2hJn6Yw/agent", {
method: "GET",
headers: {
"x-client-secret": clientSecret,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();
Python
import httpx
response = httpx.get(
"https://api.intents.fi/v0/checkout/inv_3QkR7mVt9zLpXdB2hJn6Yw/agent",
headers={"x-client-secret": client_secret},
)
response.raise_for_status()
data = response.json()
{ "error": { "code": "INVOICE_EXPIRED", "message": "This invoice has expired" } }

Switch on code, not on the message: every code has a page under Error codes. Base URL https://api.intents.fi; the whole reference is on one page.