Skip to main content

Method Signature

align.externalAccounts.create(
  customerId: string,
  data: CreateExternalAccountRequest
): Promise<ExternalAccount>

Parameters

customerId
string
required
Customer identifier
account_type
'us' | 'iban'
required
Account type
bank_name
string
required
Name of the bank
account_holder_type
'individual' | 'business'
required
Type of account holder
account_holder_address
object
required

US Account Fields (required if account_type is ‘us’)

us
object

IBAN Account Fields (required if account_type is ‘iban’)

iban
object

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.