# TypeScript SDK — Account Services: Banking & Payments

Link bank accounts and manage payment methods. All methods are on `client.accountServices`.

See the [API specifications](/api-specifications) for full request/response schemas and the [authentication guide](/tools/typescript-sdk/authentication) for setup.

## Methods

### addBank

`POST /v1/payments/addbank` · Authenticated

Links a US bank account for fiat deposits and withdrawals. The request body is [validated client-side](/tools/typescript-sdk/deep-dives/request-validation). The SDK enforces:

- `accountnumber` — required string
- `routing` — required string
- `name` — required string (account holder name)
- `type` — required enum: `"checking"` or `"savings"`

```ts
const result = await client.accountServices.addBank({
  accountnumber: "123456789",
  routing: "021000021",
  name: "Jane Doe",
  type: "checking",
});
```

This is a POST mutation — never automatically retried. Double-check account details before submitting; linking an incorrect account requires manual correction.

### addBankCAD

`POST /v1/payments/addbank/cad` · Authenticated

Links a Canadian bank account for CAD deposits and withdrawals. The request body is [validated client-side](/tools/typescript-sdk/deep-dives/request-validation). The SDK enforces:

- `swiftcode` — required string
- `accountNumber` — required string
- `name` — required string
- `type` — required enum: `"checking"` or `"savings"`
- `institutionNumber`, `branchnnumber` — optional strings

```ts
const result = await client.accountServices.addBankCAD({
  swiftcode: "ROYCCAT2",
  accountNumber: "1234567",
  name: "Jane Doe",
  type: "checking",
  institutionNumber: "003",
  branchnnumber: "00012",
});
```

> **Note:** The field name `branchnnumber` (with double "n") matches the API specification exactly.

### listPaymentMethods

`POST /v1/payments/methods` · Authenticated

Returns all payment methods linked to the account. The response is a **wrapper object** with `balances` and `banks` arrays — not a bare array.

```ts
const methods = await client.accountServices.listPaymentMethods({});

// Fiat balances available for trading
for (const balance of methods.balances ?? []) {
  console.log(`${balance.currency}: ${balance.available} available`);
}

// Linked bank accounts
for (const bank of methods.banks ?? []) {
  console.log(`${bank.bank} (${bank.bankId})`);
}
```

This is a POST mutation — never automatically retried.

### listCustodyFeeTransfers

`POST /v1/custodyaccountfees` · Authenticated

Returns custody fee transfers for custody accounts. The request body accepts an optional `timestamp` field (bigint or number) for filtering. The response is a bare array.

```ts
const fees = await client.accountServices.listCustodyFeeTransfers({});

for (const fee of fees) {
  console.log(`${fee.feeAmount} ${fee.feeCurrency} — ${fee.eventType}`);
}
```

> **Tip:** Fee amounts are decimal strings. Pass `timestamp` as a bigint or number to filter results — the API returns records **on or after** the given timestamp (lower bound, forward paging), not backward.

## What's next

- [Balances & Account](/tools/typescript-sdk/reference/account-services/balances-and-account) — account details and balance queries
- [Withdrawals & Transfers](/tools/typescript-sdk/reference/account-services/withdrawals-and-transfers) — moving funds
- [Request Validation](/tools/typescript-sdk/deep-dives/request-validation) — how client-side validation works
