How To: Implement ACH Payments

Developers can implement ACH payments with Coinflow via checkout link, SDK, or API.

🏦 ACH Overview

ACH payments can be settled on-chain or off-chain. On-chain merchants can pass a transaction to <CoinflowPurchase> or the ACH checkout endpoint. This ensures funds trigger on-chain logic after settlement.

Flow:

  1. Merchant submits transaction.
  2. User initiates ACH purchase.
  3. Coinflow processes ACH (≈3 business days).
  4. On completion, Coinflow executes on-chain transaction (if provided).

Implementing ACH via SDK (React)

  1. Generate session key
$ curl -X GET https://api-sandbox.coinflow.cash/api/auth/session-key \
> -H "Authorization: YOUR_API_KEY" \
> -H "x-coinflow-auth-user-id: user123"
  1. Tokenize checkout parameters
$ curl -X POST https://api-sandbox.coinflow.cash/api/checkout/jwt-token \
> -H "Authorization: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "subtotal": {"currency":"USD","cents":500},
> "email":"user@gmail.com",
> "blockchain":"solana",
> "settlementType":"USDC"
> }'
  1. Implement <CoinflowPurchase> Component
<CoinflowPurchase
sessionKey="SESSION_KEY"
merchantId="MERCHANT_ID"
env="sandbox"
subtotal={{cents:500, currency:Currency.USD}}
email="user@email.com"
jwtToken="CHECKOUT_JWT_TOKEN"
settlementType={SettlementType.USDC}
onSuccess={(...args)=>console.log('Success', args)}
/>
  • Merchants settling on-chain may pass a transaction prop. See On-Chain ACH Transactions

Implementing ACH via API

  1. Tokenize payment data
$curl -X POST https://api-sandbox.coinflow.cash/api/checkout/jwt-token \
> -H "Authorization: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "subtotal":{"currency":"USD","cents":500},
> "email":"payer@gmail.com",
> "blockchain":"solana",
> "settlementType":"USDC"
> }'
  1. Get totals
$curl -X POST https://api-sandbox.coinflow.cash/api/checkout/totals/MERCHANT_ID \
> -H "x-coinflow-auth-session-key: SESSION_KEY" \
> -d '{
> "subtotal":{"currency":"USD","cents":500},
> "jwtToken":"CHECKOUT_JWT_TOKEN"
> }'
  1. Add customer bank account
$curl -X POST https://api-sandbox.coinflow.cash/api/customer/v2/bankAccount \
> -H "Authorization: YOUR_API_KEY" \
> -H "x-coinflow-auth-user-id: user123" \
> -d '{
> "type":"checking",
> "email":"payer@gmail.com",
> "alias":"My Checking",
> "routingNumber":"0123456789",
> "account_number":"0987654321"
> }'
  1. Get tokenized bank account
$curl -X GET https://api-sandbox.coinflow.cash/api/customer/v2 \
> -H "x-coinflow-auth-session-key: SESSION_KEY"

5.Send ACH checkout

$curl -X POST https://api-sandbox.coinflow.cash/api/checkout/ach/MERCHANT_ID \
> -H "x-coinflow-auth-session-key: SESSION_KEY" \
> -d '{
> "subtotal":{"cents":500},
> "jwtToken":"CHECKOUT_JWT_TOKEN"
> }'