Back to Prompts

Migrate from manual bank payouts to the API

Agent prompt to turn a spreadsheet-and-bank-portal payout operation into an automated, webhook-driven API flow with an auditable state machine.

Payouts
Compliance
Webhooks

Paste this prompt into your coding agent to replace CSV uploads and bank portals with programmatic payouts.

Prompt

text
You are migrating my payout operation from a manual process (spreadsheets, bank portal uploads, ops people confirming transfers) to automated BlindPay stablecoin payouts.

Before writing code, read these sources and follow them over any prior knowledge:
- https://blindpay.com/docs/llms.txt (read the payout quickstart, customers, bank accounts, quotes, and webhooks pages)
- The OpenAPI spec: curl https://api.blindpay.com/doc

Do the migration in this order:
1. Inventory the current process: where payee data lives (spreadsheet columns, database tables), which currencies and rails we pay, who approves what, and how completion is confirmed today. Produce a field-by-field mapping to BlindPay customers and bank accounts.
2. Write an idempotent backfill that onboards existing payees: terms of service, create customer, wait for KYC via webhooks, then add bank accounts. It must be resumable, log every failure with a reason (missing tax ID, unsupported country, rejected KYC), and output an exceptions list for ops instead of crashing.
3. Build the payout pipeline: for each due payment, quote (POST /v1/instances/{instance_id}/quotes), execute (POST /v1/instances/{instance_id}/payouts/evm) before quote expiry, and record the po_ ID. Preserve any existing human approval step as a gate before execution rather than removing it.
4. Replace manual confirmation with payout.complete webhooks (Svix-verified) updating my records, plus a daily reconciliation report comparing my ledger against BlindPay payout statuses.
5. Keep a manual-mode fallback per payee so ops can exclude edge cases from automation during the transition.

Constraints:
- Amounts in integer minor units; API keys server-side only.
- Test the whole pipeline on a development instance first, including the sentinel failure amounts ($666.00 forces failed, $777.00 forces refunded) to prove the failure paths work.
- Never initiate the same payment twice: key payouts on my own payment ID and check for an existing po_ before creating.

Deliverables: the field mapping, backfill script with exceptions report, the payout pipeline with approval gate, webhook-driven status updates, and the reconciliation report.

How to use

  1. Export a sample of your current payee spreadsheet and share the columns with the agent.
  2. Run the backfill on a development instance first and review the exceptions list.
  3. Keep ops in the loop: the approval gate and exceptions report are what make the cutover safe.