Mercury payouts
Pay every affiliate from your Mercury account.
Cobalz is the only affiliate platform with a native Mercury Invoicing API integration. If your store banks with Mercury, you'll never wire an affiliate manually again.
How it works
Invoices issued. Status reconciled. Audit trail intact.
- 1You paste a Mercury API key in Settings → Payouts. We validate it via
GET /accountsand ask you to pick a destination account (checking or savings). - 2An hourly cron checks your local timezone. When today is your scheduled payout day, the aggregator picks every affiliate above min_payout with approved commissions in the period.
- 3For each eligible affiliate we ensure a Mercury customer exists, then create an invoice (one line per commission, or aggregated, your choice). The Mercury hosted-pay URL goes into the payout row.
- 4Mercury sends the affiliate the invoice. They click pay, ACH funds move, Mercury fires a transaction.created webhook. We re-fetch the invoice for authoritative status, mark the payout paid.
- 515-minute reconciliation cron polls every open payout against Mercury. Catches anything the webhook missed (or in sandbox where webhooks don't fire).
# Cron output, hourly per merchant timezone
$ cobalz payouts run --merchant=acme
› checking schedule (timezone=America/New_York)
✓ today is monthly_first → due
› aggregating approved commissions [2026-04-01 → 2026-04-30]
› eligible affiliates: 47 ($184,720.00 USD)
› blocked: 2 (missing W-9)
# Per affiliate
› ensuring Mercury customer for affiliate=alice@example.com
✓ customer cached (id=cus_AB123)
› creating Mercury invoice (idempotency=payout-acme-alice-2604f1d3)
✓ invoice id=inv_X9k2 · status=Unpaid · hosted=https://app.mercury.com/pay/x9k2
# After Mercury webhook fires
› transaction.created received · re-fetching invoice
✓ status=Paid · payout marked paid · commissions cleared
✓ payout.paid webhook delivered to 3 endpointsWhat ships
The whole payout pipeline.
Per-merchant Vault
API keys + webhook secrets stored in Supabase Vault, scoped to your merchant_id.
Sandbox + production
Configurable per merchant. We never confuse the two.
Account validation
Live GET /accounts call when you paste your key. We tell you immediately if it's wrong.
Idempotency keys
Deterministic payout-{merchant}-{affiliate}-{period_hash} prevents double-invoicing on retry.
Hourly cron
Vercel cron checks every merchant in their local timezone. No "missed your window" drama.
15-min reconciliation
Catches missed webhooks. Required in sandbox. Belt-and-suspenders in production.
Mercury customers cached
First invoice creates the Mercury customer; subsequent invoices reference the same id.
Per-line or aggregated
Choose invoice line strategy: one line per commission (granular) or one aggregated line.
Hosted pay URL
We surface the Mercury hosted-pay URL on the payout detail page. Your affiliate doesn't need a Mercury login.
Quick start
Connect Mercury in three steps.
- 1
Generate a Mercury API key
In Mercury, go to Settings → API, create a new token with Invoicing + Read accounts scopes. Copy it once — Mercury shows it exactly once. - 2
Paste it in Cobalz
Settings → Payouts → Connect Mercury. We validate it live, then ask you to pick a checking/savings destination account. - 3
Register the webhook
One-click "Register webhook" creates the Mercury webhook subscription pointing at/api/mercury/webhook/[merchantId], captures the signing secret into your Vault.
Why this matters
The differentiation in two sentences.
Goaffpro pays affiliates via PayPal Mass Payments. Refersion does manual ACH and charges 2.5% per transaction. FirstPromoter exports a CSV you upload to your bank.
Cobalz issues real Mercury invoices automatically, with idempotency keys, status reconciliation, and audit trail. If you bank with Mercury, this turns payday from a 4-hour task into a one-click confirmation.
- Yes No payroll software
- Yes No CSV exports
- Yes No manual ACH wires
- Yes No transaction-fee tax on every commission
FAQ
Mercury integration questions.
Do I need a Mercury account to use Cobalz?+
How are Mercury API keys stored?+
What if Mercury sends a webhook but our reconciliation cron beats it?+
How do you prevent double-invoicing on retry?+
Mercury sandbox doesn't deliver webhooks. How do you test?+
Can I send a payout outside the schedule (ad-hoc)?+
What about non-USD?+
Ready to stop wiring affiliates one at a time?
Connect your Mercury account in 60 seconds and run your first payout.