# Account Numbers
> Each account can have multiple account and routing numbers. We recommend that you use a set per vendor. This is similar to how you use different passwords for different websites. Account numbers can also be used to seamlessly reconcile inbound payments. Generating a unique account number per vendor ensures you always know the originator of an incoming payment.

[Events](https://increase.com/documentation/events.md) will be generated for this resource. The possible event categories are: `account_number.created`  and `account_number.updated`.

## The Account Number object
### Example
```json
{
  "account_id": "account_in71c4amph0vgo2qllky",
  "account_number": "987654321",
  "created_at": "2020-01-31T23:59:59Z",
  "id": "account_number_v18nkfqm6afpsrvy82b2",
  "idempotency_key": null,
  "inbound_ach": {
    "debit_status": "blocked"
  },
  "inbound_checks": {
    "status": "check_transfers_only"
  },
  "name": "ACH",
  "routing_number": "101050001",
  "status": "active",
  "type": "account_number"
}
```
### Attributes
- `account_id` (string)
  The identifier for the account this Account Number belongs to.

- `account_number` (string)
  The account number.

- `created_at` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Account Number was created.

- `id` (string)
  The Account Number identifier.

- `idempotency_key` (string, nullable)
  The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

- `inbound_ach` (dictionary)
  Properties related to how this Account Number handles inbound ACH transfers.

  - `inbound_ach.debit_status` (enum)
    Whether ACH debits are allowed against this Account Number. Note that they will still be declined if this is `allowed` if the Account Number is not active.
    Cases:
    * `allowed` (ACH Debits are allowed.)
    * `blocked` (ACH Debits are blocked.)

- `inbound_checks` (dictionary)
  Properties related to how this Account Number should handle inbound check withdrawals.

  - `inbound_checks.status` (enum)
    How Increase should process checks with this account number printed on them.
    Cases:
    * `allowed` (Checks with this Account Number will be processed even if they are not associated with a Check Transfer.)
    * `check_transfers_only` (Checks with this Account Number will be processed only if they can be matched to an existing Check Transfer.)

- `name` (string)
  The name you choose for the Account Number.

- `routing_number` (string)
  The American Bankers' Association (ABA) Routing Transit Number (RTN).

- `status` (enum)
  This indicates if payments can be made to the Account Number.
  Cases:
  * `active` (The account number is active.)
  * `disabled` (The account number is temporarily disabled.)
  * `canceled` (The account number is permanently disabled.)

- `type` (string)
  A constant representing the object's type. For this resource it will always be `account_number`.

## List Account Numbers
GET /account_numbers

### Example
```curl
curl \
  --url "${INCREASE_URL}/account_numbers" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```

### Query Parameters
- `cursor` (string, optional)
  Return the page of entries after this one.

- `limit` (integer, optional)
  Limit the size of the list that is returned. The default (and maximum) is 100 objects.

- `status.in` (array of enums, optional)
  The status to retrieve Account Numbers for. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `active` (The account number is active.)
  * `disabled` (The account number is temporarily disabled.)
  * `canceled` (The account number is permanently disabled.)

- `ach_debit_status.in` (array of enums, optional)
  The ACH Debit status to retrieve Account Numbers for. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `allowed` (ACH Debits are allowed.)
  * `blocked` (ACH Debits are blocked.)

- `account_id` (string, optional)
  Filter Account Numbers to those belonging to the specified Account.

- `created_at.after` (string, optional)
  Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.before` (string, optional)
  Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_after` (string, optional)
  Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_before` (string, optional)
  Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `idempotency_key` (string, optional)
  Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

### Returns a Account Number List object:
```json
{
  "data": [
    {
      "account_id": "account_in71c4amph0vgo2qllky",
      "account_number": "987654321",
      "created_at": "2020-01-31T23:59:59Z",
      "id": "account_number_v18nkfqm6afpsrvy82b2",
      "idempotency_key": null,
      "inbound_ach": {
        "debit_status": "blocked"
      },
      "inbound_checks": {
        "status": "check_transfers_only"
      },
      "name": "ACH",
      "routing_number": "101050001",
      "status": "active",
      "type": "account_number"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Create an Account Number
POST /account_numbers

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/account_numbers" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "account_id": "account_in71c4amph0vgo2qllky",
    "name": "Rent payments"
  }'
```

### Body Parameters
- `account_id` (string, required)
  The Account the Account Number should belong to.

- `inbound_ach` (dictionary, optional)
  Options related to how this Account Number should handle inbound ACH transfers.

  - `inbound_ach.debit_status` (enum, required)
    Whether ACH debits are allowed against this Account Number. Note that ACH debits will be declined if this is `allowed` but the Account Number is not active. If you do not specify this field, the default is `allowed`.
    Cases:
    * `allowed` (ACH Debits are allowed.)
    * `blocked` (ACH Debits are blocked.)

- `inbound_checks` (dictionary, optional)
  Options related to how this Account Number should handle inbound check withdrawals.

  - `inbound_checks.status` (enum, required)
    How Increase should process checks with this account number printed on them. If you do not specify this field, the default is `check_transfers_only`.
    Cases:
    * `allowed` (Checks with this Account Number will be processed even if they are not associated with a Check Transfer.)
    * `check_transfers_only` (Checks with this Account Number will be processed only if they can be matched to an existing Check Transfer.)

- `name` (string, required)
  The name you choose for the Account Number.

## Retrieve an Account Number
GET /account_numbers/{account_number_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/account_numbers/account_number_v18nkfqm6afpsrvy82b2" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `account_number_id` (string, required)
  The identifier of the Account Number to retrieve.

## Update an Account Number
PATCH /account_numbers/{account_number_id}

### Example
```curl
curl -X "PATCH" \
  --url "${INCREASE_URL}/account_numbers/account_number_v18nkfqm6afpsrvy82b2" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "inbound_ach": {
      "debit_status": "blocked"
    },
    "status": "disabled"
  }'
```
### Path Parameters
- `account_number_id` (string, required)
  The identifier of the Account Number.

### Body Parameters
- `inbound_ach` (dictionary, optional)
  Options related to how this Account Number handles inbound ACH transfers.

  - `inbound_ach.debit_status` (enum, optional)
    Whether ACH debits are allowed against this Account Number. Note that ACH debits will be declined if this is `allowed` but the Account Number is not active.
    Cases:
    * `allowed` (ACH Debits are allowed.)
    * `blocked` (ACH Debits are blocked.)

- `inbound_checks` (dictionary, optional)
  Options related to how this Account Number should handle inbound check withdrawals.

  - `inbound_checks.status` (enum, required)
    How Increase should process checks with this account number printed on them.
    Cases:
    * `allowed` (Checks with this Account Number will be processed even if they are not associated with a Check Transfer.)
    * `check_transfers_only` (Checks with this Account Number will be processed only if they can be matched to an existing Check Transfer.)

- `name` (string, optional)
  The name you choose for the Account Number.

- `status` (enum, optional)
  This indicates if transfers can be made to the Account Number.
  Cases:
  * `active` (The account number is active.)
  * `disabled` (The account number is temporarily disabled.)
  * `canceled` (The account number is permanently disabled.)