Method Signature
align.externalAccounts.create(
customerId: string,
data: CreateExternalAccountRequest
): Promise<ExternalAccount>
Parameters
account_holder_type
'individual' | 'business'
required
Type of account holder
ISO 2-letter country code
US Account Fields (required if account_type is ‘us’)
Show US Account Properties
9-digit ABA routing number
IBAN Account Fields (required if account_type is ‘iban’)
International Bank Account Number
Examples
US Bank Account
import Align from "@tolbel/align";
const align = new Align({
apiKey: process.env.ALIGN_API_KEY!,
environment: "sandbox",
});
const account = await align.externalAccounts.create(customerId, {
account_type: "us",
bank_name: "Chase Bank",
account_holder_type: "individual",
account_holder_first_name: "Alice",
account_holder_last_name: "Smith",
account_holder_address: {
country: "US",
city: "San Francisco",
street_line_1: "123 Market St",
postal_code: "94105"
},
us: {
routing_number: "021000021",
account_number: "123456789"
}
});
console.log(`Account ID: ${account.id}`);
IBAN Bank Account
const account = await align.externalAccounts.create(customerId, {
account_type: "iban",
bank_name: "Deutsche Bank",
account_holder_type: "individual",
account_holder_first_name: "Hans",
account_holder_last_name: "Mueller",
account_holder_address: {
country: "DE",
city: "Berlin",
street_line_1: "Unter den Linden 1",
postal_code: "10117",
},
iban: {
iban_number: "DE89370400440532013000",
bic: "COBADEFFXXX",
},
});
console.log(`Account ID: ${account.id}`);
Linked bank accounts are verified automatically. Use the account ID in offramp
transfers once verified.