Skip to main content
POST https://flarehq.xyz/api/payroll/run uses an active verified merchant’s API key or merchant session. The payer is resolved from that merchant, never a body-supplied wallet. End-to-end mainnet execution remains unverified; see availability.

POST fields

The handler validates recipient shapes and applies a payments limiter and spend-limit gate. It processes transfers sequentially; no arbitrary-recipient-count or atomic all-or-nothing guarantee exists.

Replay boundary

A supplied key derives payroll_idem_{key}. A matching saved reference replays that batch rather than sending again; an explicitly different token is rejected. It does not validate a full body digest or prove changed recipient/amount input was accepted. The current POST replay lookup is by the global derived reference, not scoped by merchantId before returning the saved batch. Do not claim tenant-bound replay security; this unchanged limitation needs separate review. GET batch access is separately owner-scoped. Avoid predictable/shared keys and never use an untrusted client’s key as authorization.

Responses and wallet modes

Fresh success includes batchRef, status, totalAmount, currency, tokenAddress, recipientCount, successCount, failedCount, pendingSignatureCount, results and message. Each result has recipient, amount, token, label and SUCCESS/hash/explorer, FAILED/error or PENDING_SIGNATURE/request ID. A top-level success: true can contain failures or pending signatures. Automatic completion of the batch as external signatures land is not implemented.

GET /api/payroll/run

Same merchant resolver. With batchRef, read the saved batch only if it belongs to this merchant. Without it, list own recent batches (default 10, upper bound 50 via limit). Use positive integer limits. These are stored views, not chain scans. A POST replay has a different compact shape from a fresh result; do not require a universal pendingSignatureCount on every reply.

Evidence and notifications

Inspect each actual hash/receipt, token, parties/amount, recipient credit and saved result before another payment or retry. Gas/token fees can be additional. Timeout, HTTP status or queued external request alone cannot decide whether money moved. The route sends payroll.completed for non-AWAITING_SIGNATURES outcomes, including partial/failure states. It is unsigned/best-effort, not a guaranteed success event or automatic replay schedule.