## Create Bank Account

`print_mail.bank_accounts.create(BankAccountCreateParams**kwargs)  -> BankAccount`

**post** `/print-mail/v1/bank_accounts`

Create a bank account. A US bank account is created by setting `bankCountryCode` to `US` and providing `accountNumber` and `routingNumber`. A canadian bank account can be created by specifying `bankCountryCode` as `CA` and setting `accountNumber`, `routeNumber`, and `transitNumber` accordingly.

You must specify _either_ `signatureImage` or `signatureText`. The image can be supplied as either a URL or a multipart file upload.

### Parameters

- `account_number: str`

  The account number of the bank account.

- `bank_country_code: BankAccountCountryCode`

  Countries typically have different bank account formats and standards. These are the countries
  which PostGrid's bank accounts API supports.

  - `"CA"`

  - `"US"`

- `bank_name: str`

  The name of the bank.

- `signature_text: str`

  The signature text of the bank account.

- `bank_primary_line: Optional[str]`

  The primary address line of the bank.

- `bank_secondary_line: Optional[str]`

  The secondary address line of the bank.

- `ca_designation_number: Optional[str]`

  The designation number of the bank account (for CA).

- `description: Optional[str]`

  An optional string describing this resource. Will be visible in the API and the dashboard.

- `metadata: Optional[Dict[str, object]]`

  See the section on Metadata.

- `route_number: Optional[str]`

  The route number of the bank account (for CA).

- `routing_number: Optional[str]`

  The routing number of the bank account (for US).

- `transit_number: Optional[str]`

  The transit number of the bank account (for CA).

### Returns

- `class BankAccount: …`

  - `id: str`

    A unique ID prefixed with bank_account_

  - `account_number: str`

    The account number of the bank account.

  - `bank_country_code: BankAccountCountryCode`

    Countries typically have different bank account formats and standards. These are the countries
    which PostGrid's bank accounts API supports.

    - `"CA"`

    - `"US"`

  - `bank_name: str`

    The name of the bank.

  - `created_at: datetime`

    The UTC time at which this resource was created.

  - `live: bool`

    `true` if this is a live mode resource else `false`.

  - `object: Literal["bank_account"]`

    Always `bank_account`.

    - `"bank_account"`

  - `updated_at: datetime`

    The UTC time at which this resource was last updated.

  - `bank_primary_line: Optional[str]`

    The primary address line of the bank.

  - `bank_secondary_line: Optional[str]`

    The secondary address line of the bank.

  - `ca_designation_number: Optional[str]`

    The designation number of the bank account (for CA).

  - `description: Optional[str]`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `metadata: Optional[Dict[str, object]]`

    See the section on Metadata.

  - `route_number: Optional[str]`

    The route number of the bank account (for CA).

  - `routing_number: Optional[str]`

    The routing number of the bank account (for US).

  - `signature_image: Optional[str]`

    A signed link to the signature image uploaded when this bank account was created. This is omitted if `signatureText` is present.

  - `signature_text: Optional[str]`

    The signature text PostGrid uses to generate a signature for cheques created using this bank account. This is omitted if `signatureImage` is present.

  - `transit_number: Optional[str]`

    The transit number of the bank account (for CA).

### Example

```python
import os
from postgrid import PostGrid

client = PostGrid(
    print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"),  # This is the default and can be omitted
)
bank_account = client.print_mail.bank_accounts.create(
    account_number="1234567",
    bank_country_code="US",
    bank_name="Test Bank",
    signature_text="Example",
    bank_primary_line="145 mulberry st",
    bank_secondary_line="new york ny 10013",
    routing_number="123456789",
)
print(bank_account.id)
```

#### Response

```json
{
  "id": "bank_account_12345",
  "object": "bank_account",
  "live": false,
  "bankName": "Test Bank",
  "bankPrimaryLine": "145 mulberry st",
  "bankSecondaryLine": "new york ny 10013",
  "bankCountryCode": "US",
  "accountNumber": "1234567",
  "routingNumber": "123456789",
  "signatureText": "Signature",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z"
}
```
