POST and GET https://flarehq.xyz/api/merchant/payment-link accept an active verified merchant’s API key or merchant_token session. An internal service key alone is not a merchant identity here. Keep keys server-side and let the browser manage its HTTP-only cookie.
Links are frozen single invoices with a 24-hour expiry, not permanent multi-use products. The server freezes the authenticated merchant’s name, ID, wallet and USDC token into a PENDING PaymentLog row. Creating a link transfers nothing.
The customer pays directly to the merchant wallet; FlareHQ never holds checkout funds. Creating a link stores a PENDING invoice and transfers nothing. Read mainnet availability.
POST fields
The payout wallet must already be configured. There is no product
name/price, recipient override, activation switch, shipping-address collection or reusable-link API.
reference, checkoutUrl, numeric amount, currency, canonical token, echoed description, merchant and expiresIn: '24 hours'.
GET view
GET uses the same merchant resolver and returns{ success: true, links }. It first queries the newest 100 rows belonging to merchantId, then filters for the selected network. It is not a separate reusable-product table and has no pagination parameters.
Each entry includes:
reference, numericamount,currency, canonicaltokenandcheckoutUrl.rawStatusfrom storage;status/displayStatusderived for the view.isExpired, storedexpiresAtand creationcreatedAt.
status/displayStatus is EXPIRED while rawStatus can remain PENDING. GET does not update the row or reconcile live receipts.
Errors and settlement
401 means the merchant did not resolve; 400 covers invalid amount or missing payout wallet; 404 covers a missing merchant record. POST uses the shared payments limiter. Inspect the actual body for server/token failures.
Use /checkout/{reference} or /checkout/embed/{reference}. Before fulfillment, read the cached verification view, compare your own frozen order and actual transaction evidence, and fulfill once. Top-level status: true is not payment success.
Do not retry creation or replace an expired link until you have checked any in-flight payment. Webhooks are unsigned/best-effort, and description is not a reliable persisted order identifier.
