## Create Bank Account

**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.

### Body Parameters

- `body: object { accountNumber, bankCountryCode, bankName, 9 more }  or object { accountNumber, bankCountryCode, bankName, 9 more }  or object { accountNumber, bankCountryCode, bankName, 9 more }`

  - `BankAccountCreateSignatureText object { accountNumber, bankCountryCode, bankName, 9 more }`

    - `accountNumber: string`

      The account number of the bank account.

    - `bankCountryCode: BankAccountCountryCode`

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

      - `"CA"`

      - `"US"`

    - `bankName: string`

      The name of the bank.

    - `signatureText: string`

      The signature text of the bank account.

    - `bankPrimaryLine: optional string`

      The primary address line of the bank.

    - `bankSecondaryLine: optional string`

      The secondary address line of the bank.

    - `caDesignationNumber: optional string`

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

    - `description: optional string`

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

    - `metadata: optional map[unknown]`

      See the section on Metadata.

    - `routeNumber: optional string`

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

    - `routingNumber: optional string`

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

    - `transitNumber: optional string`

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

  - `BankAccountCreateSignatureImageURL object { accountNumber, bankCountryCode, bankName, 9 more }`

    - `accountNumber: string`

      The account number of the bank account.

    - `bankCountryCode: BankAccountCountryCode`

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

    - `bankName: string`

      The name of the bank.

    - `signatureImage: string`

      Link to signature image which PostGrid will download and apply to cheques created with this bank account.

    - `bankPrimaryLine: optional string`

      The primary address line of the bank.

    - `bankSecondaryLine: optional string`

      The secondary address line of the bank.

    - `caDesignationNumber: optional string`

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

    - `description: optional string`

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

    - `metadata: optional map[unknown]`

      See the section on Metadata.

    - `routeNumber: optional string`

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

    - `routingNumber: optional string`

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

    - `transitNumber: optional string`

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

  - `BankAccountCreateSignatureImageFile object { accountNumber, bankCountryCode, bankName, 9 more }`

    - `accountNumber: string`

      The account number of the bank account.

    - `bankCountryCode: BankAccountCountryCode`

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

    - `bankName: string`

      The name of the bank.

    - `signatureImage: string`

      A PNG or JPEG file which PostGrid will apply to checks created with this bank account.

    - `bankPrimaryLine: optional string`

      The primary address line of the bank.

    - `bankSecondaryLine: optional string`

      The secondary address line of the bank.

    - `caDesignationNumber: optional string`

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

    - `description: optional string`

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

    - `metadata: optional map[unknown]`

      See the section on Metadata.

    - `routeNumber: optional string`

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

    - `routingNumber: optional string`

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

    - `transitNumber: optional string`

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

### Returns

- `BankAccount object { id, accountNumber, bankCountryCode, 15 more }`

  - `id: string`

    A unique ID prefixed with bank_account_

  - `accountNumber: string`

    The account number of the bank account.

  - `bankCountryCode: BankAccountCountryCode`

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

    - `"CA"`

    - `"US"`

  - `bankName: string`

    The name of the bank.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `live: boolean`

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

  - `object: "bank_account"`

    Always `bank_account`.

    - `"bank_account"`

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `bankPrimaryLine: optional string`

    The primary address line of the bank.

  - `bankSecondaryLine: optional string`

    The secondary address line of the bank.

  - `caDesignationNumber: optional string`

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

  - `description: optional string`

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

  - `metadata: optional map[unknown]`

    See the section on Metadata.

  - `routeNumber: optional string`

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

  - `routingNumber: optional string`

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

  - `signatureImage: optional string`

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

  - `signatureText: optional string`

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

  - `transitNumber: optional string`

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

### Example

```http
curl https://api.postgrid.com/print-mail/v1/bank_accounts \
    -H 'Content-Type: application/json' \
    -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \
    -d '{
          "accountNumber": "accountNumber",
          "bankCountryCode": "CA",
          "bankName": "bankName",
          "signatureText": "signatureText"
        }'
```

#### 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"
}
```
