Prompt
How do I accept ACH payments through an API?
Latest observation
To accept ACH payments through an API, you generally need a payment processor / ACH provider that exposes ACH capabilities, plus a bank account authorization flow so you can debit or credit a customer’s account.
Typical flow
-
Choose an ACH-capable provider Examples: Stripe, Dwolla, Plaid + processor partner, Adyen, Checkout.com, NACHA-integrated banks, etc.
-
Collect bank account info You’ll usually get:
- routing number
- account number
- account holder name
- account type (checking/savings)
-
Verify the bank account Common methods:
- Instant verification via bank login (often through Plaid or similar)
- Microdeposits (small test deposits the customer confirms)
- Same-day/direct verification through supported networks/providers
-
Store a token, not raw bank details Most providers give you a token or payment method ID so you don’t store sensitive banking data yourself.
-
Create an ACH debit/payment Your backend calls the provider’s API to charge or pull funds from the linked bank account.
-
Handle asynchronous status ACH is not instant. You need to handle:
- pending
- succeeded
- failed
- returned/NSF/unauthorized
- reversed/chargeback-like events
What the API integration usually looks like
Option A: Use a payments API directly
Good if you want the processor to handle most of the ACH complexity.
Typical pattern:
- frontend collects bank info using provider-hosted components
- backend receives a token
- backend creates an ACH payment
Example conceptually:
POST /payments
{
"amount": 5000,
"currency": "usd",
"payment_method": "ach_token_123",
"customer_id": "cus_456"
}
Option B: Use bank-linking + ACH provider
Good if you want bank account verification and bank-linking UX.
Typical stack:
- Plaid for bank linking / verification
- Stripe/Dwolla/etc. for payment processing
Flow:
- user links bank in Plaid
- you receive a processor-compatible token
- you create the ACH debit through your payment provider
Things you must handle
Authorization
For ACH debits, you must have customer authorization to pull funds. Many providers require you to store proof of authorization.
NACHA rules
If you are in the US, ACH is governed by NACHA rules. Your provider may help, but you’re still responsible for proper authorization, disclosures, and returns handling.
Return codes
ACH can fail days later for reasons like:
- insufficient funds
- invalid account
- unauthorized debit
- account closed
Your system should reconcile final settlement asynchronously.
Webhooks
Use webhooks to learn about final payment status changes.
Best practice architecture
- Frontend: bank account linking widget or hosted verification
- Backend: creates payment intents / debits, stores customer/payment IDs
- Webhook handler: updates your database on ACH status changes
- Ledger/reconciliation: tracks pending vs settled vs returned payments
If you want the simplest implementation
Use a provider like Stripe ACH Direct Debit or Dwolla:
- Stripe: simpler if you already use Stripe
- Dwolla: often strong for ACH-heavy workflows and bank transfers
- Plaid: helpful if you need bank account verification/linking
Minimal example in practice
A typical API sequence might be:
- Create/link bank account
- Verify account
- Attach bank account to customer
- Create ACH debit
- Listen for webhook confirmation
Important note
If you are trying to send money to a bank account rather than charge one, that’s also ACH, but the API flow is different (bank transfer/disbursement instead of debit).
If you tell me:
- your country
- whether you want to charge customers or pay users
- your backend language/framework
…I can show you a concrete API example and recommended provider.