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_tokensession, under consumer send/request semantics.
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
SendContent-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 containssuccess, message, reference, checkoutUrl, agent, data and token.
data.amountis the validated amount string;data.currencyis canonical.data.statusisready, not the invoice’s paid status. The stored invoice isPENDING.data.authorization_urlis/checkout/{reference}.tokencontains canonicalsymbol,addressanddecimals.agentis null or contains availablename,scaAddress, ERC-8004tokenIdandcircleWalletId. It is not an interchangeable Registry ID.expiresAtis 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.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.

