> ## Documentation Index
> Fetch the complete documentation index at: https://developers.staging01.melio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Accounts

Melio models both sides of a payment as accounts. An **internal** account is a funding source owned by the entity - the money comes out of it. An **external** account is a payee's delivery method - the money goes into it. Every payment links exactly one internal account to one external account.

## Ownership types

The `ownershipType` field indicates which side of the payment the account belongs to:

* **`internal`** - funding sources owned by the entity. Can be an ACH bank account or a card.
* **`external`** - delivery methods for payees. Can be ACH, paper check, domestic wire, or virtual card.

## Account types

| `ownershipType` | `type`          | Description                                                                                                     |
| --------------- | --------------- | --------------------------------------------------------------------------------------------------------------- |
| `internal`      | `ach`           | Bank account (checking or savings) added via raw routing/account numbers (approved partners only) or via Plaid. |
| `internal`      | `card`          | Debit or credit card added through the account link portal.                                                     |
| `external`      | `ach`           | Payee's bank account, credited via ACH.                                                                         |
| `external`      | `check`         | Mailed paper check sent to the payee's address.                                                                 |
| `external`      | `domestic-wire` | Domestic wire transfer to a routing and account number.                                                         |
| `external`      | `virtual-card`  | Single-use virtual card delivered to the payee by email.                                                        |

## Bank account verification

The `isVerified` field reflects whether Melio has confirmed the entity controls the account. It is present only on **internal** accounts; for external accounts (payees, `ownershipType: external`) verification does not apply and the field is absent.

An internal account is added either through **Plaid** or, **for selected partners only**, by supplying the account and routing numbers directly.

An internal ACH account starts as `isVerified: false` and must be verified before you can originate a payment from it. Verification is a Plaid-hosted micro-deposit flow:

1. Call `POST /accounts/{accountId}/verify/link` to get a short-lived, Melio-hosted link.
2. Hand the link to the entity. It opens a Melio-hosted page where they complete same-day micro-deposit verification in Plaid.
3. When verification completes, `isVerified` flips to `true`. Subscribe to `api.account.updated` to learn when this happens.

Until `isVerified` is `true`, payments cannot be originated from the account.

## Card accounts

Internal **card** accounts are added through a tokenized card flow rather than the micro-deposit flow used for bank accounts. The card is captured as a vault token along with its BIN, expiry, cardholder name, and billing address, so the raw card number never passes through your servers.

A card account is added in one of two ways, both of which feed the same tokenized flow:

* **Hosted card flow** - mint a link with `POST /accounts/link` (`type: card`). The entity completes card entry on a Melio-hosted page that adds the internal account for them.
* **Direct** - approved partners may submit the vaulted card token and its details to `POST /accounts` themselves.

## Account ID

Every account receives an opaque identifier starting with `acct_` (for example, `acct_7nRv3xBqY5tM`). Pass this ID as `originatingAccountId` (internal) or `receivingAccountId` (external) when you create a payment. Set `externalId` if you want to attach your own reference - for example, your internal ledger ID for the bank account. You can filter account list endpoints by `externalId` to look up accounts without storing Melio IDs.

## Scoped link flow

For Plaid-linked bank accounts and card accounts, you cannot collect credentials directly - those flows require a hosted portal. Use `POST /accounts/link` to generate a short-lived, entity-scoped URL:

```http theme={null}
POST /v2/accounts/link HTTP/1.1
Host: api.melio.com
api-key: YOUR_API_KEY
Melio-Entity-Id: ent_4kQz9mXpR2wL
Content-Type: application/json
{
  "type": "ach",
  "ownershipType": "internal",
  "linkMethod": "plaid"
}
```

Redirect or embed the returned `linkUrl` for the entity's user. When they complete the flow, Melio creates the account automatically and the URL expires. You can poll `GET /accounts` or listen for the `account.created` webhook to detect when the account is ready.
