Skip to main content
POST https://flarehq.xyz/api/payments/initialize creates a new arc_ref_... invoice with a 120-minute expiry. Each successful POST creates a distinct reference; the handler has no client order-idempotency key. Save the reference against your order before returning the checkout URL. The customer pays directly to the merchant wallet; FlareHQ never holds checkout funds. Creating an invoice stores a PENDING record and moves nothing. The API-key example below is illustrative, not a performed production request. Read mainnet availability.

Authentication

The current resolver accepts:
  • A verified active merchant’s x-api-key; the server resolves that merchant’s business name and payout wallet.
  • An active internal service key, under separate internal-call semantics.
  • A database-bound consumer_token session, under consumer send/request semantics.
A bare merchant_token is not accepted by this initialize resolver. Use the merchant API key here, or the separate merchant payment-link endpoint, which supports the merchant session. An invalid supplied key does not fall back to a cookie. Keep keys server-side.

Request fields

Send Content-Type: application/json. An own-wallet consumer request with omitted or equal payoutAddress skips payment PIN; authenticated production web/assistant creation confirmed this. Consumer send and a request naming a foreign payout retain applicable step-up. A web foreign request returned 403 STEP_UP_REQUIRED without creating an invoice. Foreign request payouts are not silently discarded. Unsupported SDK fields include recipient, successUrl, cancelUrl, metadata and description. Do not assume they are stored or trigger a redirect.

Response

The success response contains success, message, reference, checkoutUrl, agent, data and token.
  • data.amount is the validated amount string; data.currency is canonical.
  • data.status is ready, not the invoice’s paid status. The stored invoice is PENDING.
  • data.authorization_url is /checkout/{reference}.
  • token contains canonical symbol, address and decimals.
  • agent is null or contains available name, scaAddress, ERC-8004 tokenId and circleWalletId. It is not an interchangeable Registry ID.
  • expiresAt is stored but not returned at the top level here; read the verification view.

Backend example

This illustrative request creates an invoice only; it has not been executed with an authenticated production account.
Missing auth returns 401; invalid fields/token or a missing merchant payout wallet return 400; missing agent returns 404; foreign merchant agent or consumer step-up failures are rejected. The route uses the shared payments rate-limit tier where configured. A cached invoice can remain PENDING after its deadline. Inspect any submitted payment before replacing the invoice; do not blindly replay initialization after a timeout.