## Collect bank account details for setup Use `stripe.collectBankAccountForSetup` in the [Save bank details](/payments/ach-direct-debit/set-up-payment.md) flow for the [ACH Direct Debit](/payments/ach-direct-debit.md) payment method to collect the customer’s bank account in your payment form. When called, it will automatically load an on-page modal UI to collect bank account details and verification, and attach the [PaymentMethod](/api/payment_methods.md) to the [SetupIntent](/api/setup_intents.md). When the `stripe.collectBankAccountForSetup` completes successfully, it returns a SetupIntent. If the customer provided their account, the SetupIntent is in the `requires_confirmation` state. If the customer closed the dialog without providing their account, the SetupIntent is in the `requires_payment_method` state. Use [stripe.confirmUsBankAccountSetup](/js/setup_intents/confirm_us_bank_account_setup) to complete the process. **Syntax:** `stripe.collectBankAccountForSetup(...)` - `options` (object) **required** Data to be sent with the request. - `clientSecret` (string) **required** The [client secret](/api/setup_intents/object.md#setup_intent_object-client_secret) of the `SetupIntent`. - `params` (object) **required** - `payment_method_type` (string) **required** The payment method type for the bank account details (e.g. `us_bank_account`) - `payment_method_data` (object) **required** Payment method specific data to be sent with the request - `billing_details` (Object) **required** The customer's [billing_details](/api/payment_methods/create.md#create_payment_method-billing_details). `name` is required. Providing `email` allows your customer to receive [ACH Direct Debit mandate and microdeposit emails](/payments/ach-direct-debit.md#mandate-and-microdeposit-emails). - `name` (string) **required** The customer's name. The first and last name must be at minimum 2 characters each. - `email` (string) The customer's email. - `address` (Object) The customer's billing address. - `city` (string) City, district, suburb, town, or village. - `country` (string) Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - `line1` (string) Address line 1 (e.g., street, PO Box, or company name). - `line2` (string) Address line 2 (e.g., apartment, suite, unit, or building). - `postal_code` (string) ZIP or postal code. - `state` (string) State, county, province, or region. ### Collect bank account details for setup ```js stripe.collectBankAccountForSetup( { clientSecret: '{SETUP_INTENT_CLIENT_SECRET}', params: { payment_method_type: 'us_bank_account', payment_method_data: { billing_details: {name: 'Jenny Rosen', email: 'jenny@example.com'}, }, }, } ).then(function(result) { // Handle result.error or result.setupIntent }); ``` ```es_next const {setupIntent, error} = await stripe.collectBankAccountForSetup( { clientSecret: '{SETUP_INTENT_CLIENT_SECRET}', params: { payment_method_type: 'us_bank_account', payment_method_data: { billing_details: {name: 'Jenny Rosen', email: 'jenny@example.com'}, }, }, } ); // Handle the setupIntent or error ```