POST /api/payroll/run call. You supply a recipients array — each with a wallet address and a USDC amount — and FlareHQ transfers funds sequentially from the authenticated merchant’s own wallet. The response returns a batchRef and a per-recipient result list, so you can reconcile the run exactly as it happened.
The payer wallet is never taken from the request body. FlareHQ resolves the payer server-side from your authenticated merchant (via x-api-key or dashboard session), so a caller with a valid API key can only spend their own wallet — not name an arbitrary wallet as payer.
Use Cases
Monthly Employee Payouts
Send the whole payroll in one call — each employee lands their exact USDC amount with a label for your ledger.
Contractor & Bounty Payments
Pay dozens of freelance contributors and bounty hunters at once, each with a distinct memo.
Agent Fleet Compensation
Settle compensation for a fleet of autonomous agents in a single batch, keyed by agent wallet address.
Recurring Supplier Invoices
Cover multiple vendor invoices in one run, with
webhookUrl notifying your backend when the batch lands.How Payroll Works
- Submit the batch — You
POSTarecipientsarray to/api/payroll/run. A batch record is created with statusPROCESSING. - Payer resolved — FlareHQ resolves the paying wallet from your authenticated merchant account, never from the body.
- Sequential transfers — Each recipient is paid one at a time to avoid wallet nonce collisions.
- Reconcile — Every recipient returns
SUCCESS,PENDING_SIGNATURE, orFAILED, and the batch lands in a final status.
Running a Payroll Batch
REST API Parameters
array
required
A non-empty array of recipients to pay. An empty or missing array returns
HTTP 400 with an example payload. Each item has the following shape:string
URL FlareHQ
POSTs to when the batch finishes, unless it ends AWAITING_SIGNATURES. See Webhook Events below.string
Optional batch description, used as the transfer memo for recipients that have no
label.There is no
payerSCA or payerWalletId parameter. The payer is resolved from the authenticated merchant’s wallet, so you cannot pay out of another merchant’s wallet.Batch Statuses
string
Per-recipient outcome:
SUCCESS— paid onchain. IncludestxHashandexplorerUrl.PENDING_SIGNATURE— a signature is queued for your external wallet. IncludesrequestId.FAILED— the transfer could not be completed. Includeserror.
External Wallets and AWAITING_SIGNATURES
A Circle-custodied wallet is paid directly — each recipient returnsSUCCESS with a txHash. An external (non-custodial) wallet is different: because there is no batch-signing across unrelated transfers on a standard EOA, each recipient payment produces its own signature request. A payroll batch on an external wallet therefore returns up to N PENDING_SIGNATURE results and ends with status AWAITING_SIGNATURES.
To finish the run, approve each queued request via /api/merchant/wallet/sign-requests. Auto-resuming the batch as signatures land is not yet implemented — after signing, re-check the batch with the GET endpoint to see which payments confirmed.
Checking a Batch (GET)
Re-fetch a batch record at any time by its reference:payerSCA, status, successCount, failedCount, the per-recipient results, and completedAt. Omitted batchRef → HTTP 400; unknown batchRef → HTTP 404.
Webhook Events
The webhook body carries the batch reference, final status, totals, and the full per-recipient results:
Payments are processed sequentially (not in parallel) to avoid wallet nonce collisions. The batch record is created with status
PROCESSING before transfers begin and updated to its final status when the loop completes.On a batch record,
payerWalletId stores the wallet provider kind (e.g. "circle") rather than a Circle wallet ID; the wallet lookup happens inside the wallet provider.
