Prompt
How do I accept ACH payments via API?
Latest observation
To accept ACH payments via API, you generally need to use a payments provider or bank partner that supports ACH / bank debits and exposes an API. The exact steps depend on the provider, but the flow is usually:
1) Choose an ACH-capable provider
Common options include:
- Stripe
- Plaid + a payment processor
- Dwolla
- Adyen
- Checkout.com
- Bank/processor-specific APIs
If you want the easiest implementation, Stripe or Dwolla are common starting points.
2) Set up bank account collection and verification
To debit a customer’s bank account, you need:
- Routing number
- Account number
- Sometimes account holder name
- Verification method, such as:
- Instant verification via Plaid or similar
- Microdeposits
- Bank login/tokenized bank linking
You generally should not handle raw bank details yourself unless your provider allows it and you meet compliance/security requirements.
3) Create a customer/bank account token
Most providers require you to tokenize bank details first.
Typical patterns:
- Client-side bank linking flow → returns a token/payment method ID
- Server-side create customer + attach bank account token
4) Create the ACH debit/payment
Then your server calls the provider API to charge the bank account.
Important ACH facts:
- ACH payments are not instant
- They can take 2–5 business days to settle
- You may need to handle returns/NSF/fraud
- ACH debits often require customer authorization (mandate)
5) Listen for webhooks
Use webhooks to track:
- Payment pending
- Payment succeeded
- Payment failed
- Returned/reversed
- Disputed
You should not assume success immediately after creation.
Example: Stripe ACH debit flow
A typical Stripe flow is:
- Collect bank account details using Stripe.js or Financial Connections
- Create a PaymentMethod for ACH
- Attach it to a Customer
- Confirm a PaymentIntent
- Handle webhooks for final settlement
Pseudo-flow:
// Server: create PaymentIntent
const paymentIntent = await stripe.paymentIntents.create({
amount: 5000,
currency: 'usd',
payment_method_types: ['us_bank_account'],
});
Then on the client, collect/link the bank account and confirm the payment.
Example: Dwolla
Dwolla is very ACH-focused. Typical flow:
- Create customer
- Add funding source (bank account)
- Verify bank account
- Create transfer/debit
This is often simpler if ACH is your main payment rail.
Compliance / security considerations
ACH has specific requirements:
- Get explicit customer authorization
- Store authorization records
- Follow NACHA rules
- Use PCI-like secure handling for bank data
- Implement fraud checks and return handling
Recommended approach
If you’re starting from scratch:
- For general payments: Stripe
- For ACH-first workflows: Dwolla
- For bank linking + verification: Plaid + processor
If you want, I can give you:
- a Stripe ACH implementation example in Node/Python,
- a Dwolla ACH example, or
- a provider comparison to help you choose.