ACH Guide

Stripe supports accepting ACH payments—direct from bank accounts—alongside credit cards. If you need help after reading this, check out our answers to common questions or chat live with other developers in #stripe on freenode.

With Stripe, you can accept ACH payments in nearly the same way as you accept credit card payments, merely providing a verified bank account as the source argument for a charge request. However, accepting bank accounts requires a slightly different initial workflow than accepting credit cards:

  1. Bank accounts must first be verified.
  2. Bank accounts must be authorized for your use by the customer.

Once both steps have been taken for a bank account, it can mostly be used just like any other payment source, including for recurring charges and Connect applications. The two key differences between using bank accounts and credit cards are:

  • ACH payments take up to 5 business days to receive acknowledgment of their success or failure. Because of this, ACH payments take up to 7 business days to be reflected in your available Stripe balance.
  • You can only accept funds in USD and only from US bank accounts. In addition, your account must have a US/USD bank account to accept ACH payments.

Collecting and verifying bank accounts

Before you can create an ACH charge, you must first collect and verify your customer’s bank account and routing number. In order to properly identify the bank account, you will also need to collect the name of the person or business who owns the account, and if the account is owned by an individual or a company. Stripe provides two methods for doing so: instant collection and verification via Plaid or collection via Stripe.js with delayed-verification using micro-deposits.

As charging a bank account requires both verification of the account and customer authorization to use it, the best practice is to store the bank account on a Customer object in Stripe for easy reuse.

Using Plaid

Plaid provides the quickest way to collect and verify your customer’s banking information. Using the Stripe + Plaid integration, you’re able to instantly receive a verified bank account, allowing for immediate charging. This is done by using Plaid Link, receiving the Stripe bank account token directly from Plaid.

Integrating Plaid

Once your Plaid account is setup and connected to your Stripe account, add Plaid Link to your site.

<button id='linkButton'>Open Plaid Link</button>
<script src="https://cdn.plaid.com/link/stable/link-initialize.js"></script>
<script>
var linkHandler = Plaid.create({
  env: 'tartan',
  clientName: 'Stripe / Plaid Test',
  key: '[Plaid key]',
  product: 'auth',
  selectAccount: true,
  onSuccess: function(public_token, metadata) {
    // Send the public_token and account ID to your app server.
    console.log('public_token: ' + public_token);
    console.log('account ID: ' + metadata.account_id);
  },
});

// Trigger the Link UI
document.getElementById('linkButton').onclick = function() {
  linkHandler.open();
};
</script>

The above code uses a custom Plaid Link integration. You’ll need to replace the clientName with something meaningful to your business and the key value with your public Plaid key. An env value of tartan is for testing purposes; use production when it’s time to go live.

Once your server has the public_token, you will need to make one additional call to the Plaid server to get the Stripe bank account token along with the Plaid access token that can be used for other Plaid API requests.

curl https://tartan.plaid.com/exchange_token \
   -d client_id="[Plaid client ID]" \
   -d secret="[Plaid secret]" \
   -d public_token="[Plaid Link public_token]" \
   -d account_id="[Plaid Link account_id]"
# Using Plaid's Ruby bindings (https://github.com/plaid/plaid-ruby)
require 'plaid'

Plaid.config do |p|
  p.client_id = '[Plaid client ID]'
  p.secret = '[Plaid secret]'
  p.env = :tartan
end
user = Plaid::User.exchange_token(
  '[Plaid Link public_token]',
  '[Plaid Link account_id]',
)
bank_account_token = user.stripe_bank_account_token
# Using Plaid's Python bindings (https://github.com/plaid/plaid-python)
import plaid

plaid.Client.config({'url': 'https://tartan.plaid.com'})
plaid_client = plaid.Client(
  client_id='[Plaid client ID]',
  secret='[Plaid secret]',
)
plaid_response = plaid_client.exchange_token(
  public_token='[Plaid Link public_token]',
  account_id='[Plaid Link account_id]',
)
bank_account_token = plaid_response.json()['stripe_bank_account_token']
$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_URL => 'https://tartan.plaid.com/exchange_token',
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER, array(
        'Content-Type: application/x-www-form-urlencoded',
    ),
    CURLOPT_POSTFIELDS => http_build_query(array(
        'client_id' => '[Plaid client ID]',
        'secret' => '[Plaid secret]',
        'public_token' => '[Plaid Link public_token]',
        'account_id' => '[Plaid Link account_id]',
    )),
));
$response = curl_exec($ch);
curl_close($ch);
$bankAccountToken = json_decode($response)['stripe_bank_account_token'];
// Using Plaid's Java bindings (https://github.com/plaid/plaid-java)
import com.plaid.client.PlaidClients;
import com.plaid.client.response.PlaidUserResponse;

PlaidUserClient plaidUserClient
    = PlaidClients.testUserClient("[Plaid client ID]",
                                  "[Plaid secret]");
PlaidUserResponse response
    = plaidUserClient.exchangeToken("[Plaid Link public_token]",
                                    "[Plaid Link account_id]");
String bankAccountToken = response.getStripeBankAccountToken();
// Using Plaid's Node.js bindings (https://github.com/plaid/plaid-node)
var plaid = require('plaid');

var plaidClient = new plaid.Client('[Plaid client ID]',
                                   '[Plaid secret]',
                                   plaid.environments.tartan);
plaidClient.exchangeToken('[Plaid Link public_token]',
                          '[Plaid Link account_id]',
                          function(err, res) {
  var bankAccountToken = res.stripe_bank_account_token;
});
// Using Plaid's Go bindings (https://github.com/plaid/plaid-go)
client := plaid.NewClient("[Plaid client ID]", "[Plaid secret]", plaid.Tartan)

postRes, err := client.ExchangeTokenAccount("[Plaid Link public_token]",
    "[Plaid Link account_id]",
)
if err != nil {
    // handle error
} else {
    bankAccountToken := postRes.BankAccountToken
}

Plaid uses different API endpoints for test and production requests. The above request uses Plaid’s testing environment (“Tartan”). When it’s time to go live, you’ll need to use Plaid’s production environment:

curl https://api.plaid.com/exchange_token \
   -d client_id="[Plaid client ID]" \
   -d secret="[Plaid secret]" \
   -d public_token="[Plaid Link public_token]" \
   -d account_id="[Plaid Link account_id]"
# Using Plaid's Ruby bindings (https://github.com/plaid/plaid-ruby)
require 'plaid'

Plaid.config do |p|
  p.client_id = '[Plaid client ID]'
  p.secret = '[Plaid secret]'
  p.env = :production
end
user = Plaid::User.exchange_token(
  '[Plaid Link public_token]',
  '[Plaid Link account_id]',
)
bank_account_token = user.stripe_bank_account_token
# Using Plaid's Python bindings (https://github.com/plaid/plaid-python)
import plaid

plaid_client = plaid.Client(
  client_id='[Plaid client ID]',
  secret='[Plaid secret]',
)
plaid_response = plaid_client.exchange_token(
  public_token='[Plaid Link public_token]',
  account_id='[Plaid Link account_id]',
)
bank_account_token = plaid_response.json()['stripe_bank_account_token']
$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_URL => 'https://api.plaid.com/exchange_token',
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER, array(
        'Content-Type: application/x-www-form-urlencoded',
    ),
    CURLOPT_POSTFIELDS => http_build_query(array(
        'client_id' => '[Plaid client ID]',
        'secret' => '[Plaid secret]',
        'public_token' => '[Plaid Link public_token]',
        'account_id' => '[Plaid Link account_id]',
    )),
));
$response = curl_exec($ch);
curl_close($ch);
$bankAccountToken = json_decode($response)['stripe_bank_account_token'];
// Using Plaid's Java bindings (https://github.com/plaid/plaid-java)
import com.plaid.client.PlaidClients;
import com.plaid.client.response.PlaidUserResponse;

PlaidUserClient plaidUserClient
    = PlaidClients.productionUserClient("[Plaid client ID]",
                                        "[Plaid secret]");
PlaidUserResponse response
    = plaidUserClient.exchangeToken("[Plaid Link public_token]",
                                    "[Plaid Link account_id]");
String bankAccountToken = response.getStripeBankAccountToken();
// Using Plaid's Node.js bindings (https://github.com/plaid/plaid-node)
var plaid = require('plaid');

var plaidClient = new plaid.Client('[Plaid client ID]',
                                   '[Plaid secret]',
                                   plaid.environments.production);
plaidClient.exchangeToken('[Plaid Link public_token]',
                          '[Plaid Link account_id]',
                          function(err, res) {
  var bankAccountToken = res.stripe_bank_account_token;
});
// Using Plaid's Go bindings (https://github.com/plaid/plaid-go)
client := plaid.NewClient("[Plaid client ID]", "[Plaid secret]", plaid.Production)

postRes, err := client.ExchangeTokenAccount("[Plaid Link public_token]",
    "[Plaid Link account_id]",
)
if err != nil {
    // handle error
} else {
    bankAccountToken := postRes.BankAccountToken
}

The response will contain a verified Stripe bank account token ID. You can attach this token to a Stripe Customer object, or create a charge directly on it.

{
  "sandbox": false,
  "access_token": "[Plaid API access token]",
  "stripe_bank_account_token": "btok_O2zDC1rPwyRUfD30wLMf",
  "account_id": "[Plaid Account ID]"
}

Manually collecting and verifying bank accounts

Plaid supports instant verification for many of the most popular banks. However, if your customer’s bank is not supported or you do not wish to integrate with Plaid, collect and verify the customer’s bank using Stripe alone.

First, use Stripe.js to securely collect your customer’s bank account information, receiving a representative token in return. Once you have that, attach it to a Stripe customer in your account.

curl https://api.stripe.com/v1/customers \
   -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
   -d source=tok_4XNshPRgmDRCVi \
   -d description="Example customer"
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

# Get the bank token submitted by the form
token_id = params[:stripeToken]

# Create a Customer
customer = Stripe::Customer.create(
  :source => token_id,
  :description => "Example customer"
)
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

# Get the bank token submitted by the form
token_id = request.POST['stripeToken']

# Create a Customer
customer = stripe.Customer.create(
    source=token_id,
    description="Example customer"
)
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

\Stripe\Customer::create(array(
  "source" => $token_id,
  "description" => "Example customer"
));
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";

// Get the bank token submitted by the form
String tokenID = request.getParameter("stripeToken");

// Create a Customer
Map<String, Object> customerParams = new HashMap<String, Object>();
customerParams.put("source", tokenID);
customerParams.put("description", "Example customer");

Customer customer = Customer.create(customerParams);
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

// Get the bank token submitted by the form
var tokenID = request.body.stripeToken;

// Create a Customer
stripe.customers.create({
  source: tokenID,
  description: "Example customer"
}, function(err, customer) {

});

After adding the bank account to a customer, it needs to be verified. When using Stripe without Plaid, verification is done via two small deposits into the bank account that Stripe will automatically send. These deposits will take 1-2 business days to appear on the customer’s online statement. The statement description for these deposits will be VERIFICATION. Your customer will need to relay the value of the two deposits to you.

When accepting these values, be sure to note that there is a limit of 10 failed verification attempts. Once this limit has been crossed, the bank account will be unable to be verified. Careful messaging about what these microdeposits are and how they are used can help your end customers avoid this issue. Once you have these values, you can verify the bank account:

curl https://api.stripe.com/v1/customers/cus_7iLOlPKxhQJ75a/sources/ba_17SHwa2eZvKYlo2CUx7nphbZ/verify \
   -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
   -d amounts[]=32 \
   -d amounts[]=45
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

# get the existing bank account
customer = Stripe::Customer.retrieve("cus_7iLOlPKxhQJ75a")
bank_account = customer.sources.retrieve("ba_17SHwa2eZvKYlo2CUx7nphbZ")

# verify the account
bank_account.verify(amounts: [32, 45])
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

# get the existing bank account
customer = stripe.Customer.retrieve("cus_7iLOlPKxhQJ75a")
bank_account = customer.sources.retrieve("ba_17SHwa2eZvKYlo2CUx7nphbZ")

# verify the account
bank_account.verify(amounts= [32, 45])
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

// get the existing bank account
$customer = \Stripe\Customer::retrieve("cus_7iLOlPKxhQJ75a");
$bank_account = $customer->sources->retrieve("ba_17SHwa2eZvKYlo2CUx7nphbZ");

// verify the account
$bank_account->verify(array('amounts' => array(32, 45)));
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";

// get the existing bank account
Customer customer = Customer.retrieve("cus_7iLOlPKxhQJ75a");
ExternalAccount source = customer.getSources().retrieve("ba_17SHwa2eZvKYlo2CUx7nphbZ");

// verify the account
Map params = new HashMap<String, Object>();
ArrayList amounts = new ArrayList();
amounts.add(32);
amounts.add(45);
params.put("amounts", amounts);
source.verify(params);
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

var data = {amounts: [32,45]}
stripe.customers.verifySource(
  'cus_7iLOlPKxhQJ75a',
  'ba_17SHwa2eZvKYlo2CUx7nphbZ',
  {
    amounts: [32, 45]
  },
  function(err, bankAccount) {

});

Once the bank account is verified, you can make charges against it.

Payment authorization

Before creating an ACH charge, it is important that you’ve received authorization from your customer to debit their account. Doing so ensures compliance with the ACH network and helps protect you from disputes, additional fees, and reversed payments. See our support page for more information on authorization requirements.

Creating an ACH charge

To create a charge on a verified bank account, simply use the stored Customer object the same way you would when using a card.

curl https://api.stripe.com/v1/charges \
   -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
   -d amount=1500 \
   -d currency=usd \
   -d customer=cus_7iLOlPKxhQJ75a
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

Stripe::Charge.create(
  :amount   => 1500,
  :currency => "usd",
  :customer => customer_id # Previously stored, then retrieved
)
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

stripe.Charge.create(
    amount=1500,
    currency="usd",
    customer=customer_id # Previously stored, then retrieved
)
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

\Stripe\Charge::create(array(
  "amount" => 1500,
  "currency" => "usd",
  "customer" => $customer_id // Previously stored, then retrieved
));
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";

Map<String, Object> otherChargeParams = new HashMap<String, Object>();
otherChargeParams.put("amount", 1500);
otherChargeParams.put("currency", "usd");
otherChargeParams.put("customer", customerId); // Previously stored, then retrieved

Charge.create(otherChargeParams);
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

stripe.charges.create({
  amount: 1500,
  currency: "usd",
  customer: customerId // Previously stored, then retrieved
});

Attempting to charge an unverified bank account results in an error with the message “The customer’s bank account must be verified in order to create an ACH payment.”

If the customer has multiple stored sources (of any type), specify which bank account to use by passing its ID in as the source parameter.

Testing ACH

You can mimic successful and failed ACH charges using the following bank account and routing numbers:

  • Routing number: 110000000
  • Account number: 000123456789 (success), 000111111116 (failure upon use)

To mimic successful and failed bank account verifications, use these meaningful amounts:

  • [32, 45] (success)
  • [any other number combinations] (failure)

ACH payments workflow

ACH payments take up to 5 business days to receive acknowledgment of their success or failure:

  • When created, ACH charges will have the initial status of pending.
  • A pending balance transaction will immediately be created reflecting the payment amount, less our fee.
  • During the next 4 business days, the payment will either transition to succeeded or failed depending on the customer’s bank.
  • Successful ACH payments will be reflected in your Stripe available balance after 7 business days, at which point the funds are available for automatic or manual transfer to your bank account.
  • Failed ACH payments will reverse the pending balance transaction created.
  • Your customer will see the payment reflected on their bank statement 1-2 days after creating the charge. (Your customer will know the payment succeeded before the bank notifies Stripe.)

Failures can happen for a number of reasons such as: insufficient funds, a bad account number, or the customer disabled debits from their bank account.

ACH disputes

Disputes on ACH payments are fundamentally different than those on the credit card payments. If a customer disputes a charge and the customer’s bank accepts the request to return the funds, Stripe immediately removes the funds for the charge from your Stripe account. Unlike credit card disputes, you are not able to contest ACH reversals. You will need to directly reach out to your customer to resolve the situation.

The ACH network allows 60 days for consumers to contest a debit on their account. Business accounts only have 2 business days, but since there is no way to be sure that the end account is a business account or personal account, you should never rely on this as a way to reduce risk.

ACH refunds

Like other payment methods, ACH charges can be refunded using the Refund endpoint. However, the timing and risks associated with ACH refunds are different than card refunds. To learn more about those differences, please refer to our support guide.

If a refund for an ACH charge fails, you will receive a charge.refund.updated notification. This means that we have been unable to process the refund, and you must return the funds to your customer outside of Stripe. This is rare; normally occurring when an account is frozen between the original charge and the refund request

ACH-specific webhook notifications

When using ACH, you will receive many of the standard charge webhook notifications, with a couple of notable differences:

  • After creating the charge, you will receive a charge.pending notification. You will not receive charge.succeeded or charge.failed notification until up to 5 business days later.
  • You will receive a charge.succeeded notification once the charge has transitioned to succeeded and the funds are available in your balance.
  • You will receive a charge.failed notification if the ACH transfer fails for any reason. The charge’s failure_code and failure_message will be set, and the funds will be reversed from your Stripe pending balance at this point.
  • You will receive a customer.source.updated notification when the bank account is properly verified. The bank account’s status will be set to verified.
  • If the bank account could not be verified because either of the two small deposits failed, you will receive a customer.source.updated notification. The bank account’s status will be set to verification_failed.

Connect support

Applications can create ACH payments on behalf of connected accounts and collect an application_fee. As with credit card payments, you can either:

  • Create the customer in the platform account and use the destination parameter to create the charge for the connected user (as in the code below)
  • Create the customer in a connected account and create the charge directly on that account
curl https://api.stripe.com/v1/charges \
   -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
   -d amount=1500 \
   -d currency=usd \
   -d customer=cus_7iLOlPKxhQJ75a \
   -d destination="{CONNECTED_STRIPE_ACCOUNT_ID}"
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

Stripe::Charge.create(
  :amount   => 1500,
  :currency => "usd",
  :customer => customer_id, # Previously stored, then retrieved
  :destination => {CONNECTED_STRIPE_ACCOUNT_ID}
)
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

stripe.Charge.create(
    amount=1500,
    currency="usd",
    customer=customer_id, # Previously stored, then retrieved
    destination={CONNECTED_STRIPE_ACCOUNT_ID}
)
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

// Get the credit card details submitted by the form
$token = $_POST['stripeToken'];

$order = \Stripe\Order::retrieve("or_19P4Ee2eZvKYlo2C3kA3J2hO");

$order->pay(array("source" => $token));
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";

Map<String, Object> otherChargeParams = new HashMap<String, Object>();
otherChargeParams.put("amount", 1500);
otherChargeParams.put("currency", "usd");
otherChargeParams.put("customer", customerId); // Previously stored, then retrieved
otherChargeParams.put("destination", {CONNECTED_STRIPE_ACCOUNT_ID});

Charge.create(otherChargeParams);
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

stripe.charges.create({
  amount: 1500,
  currency: "usd",
  customer: customerId, // Previously stored, then retrieved
  destination: {CONNECTED_STRIPE_ACCOUNT_ID}
});

Services Agreement

Use of the live mode API is subject to the Stripe Services Agreement. Let us know if you have any questions on that agreement.