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

# Sending an internal transfer

> Send an internal transfer between your own accounts: prerequisites, request requirements, what you get back, and what to watch for.

Create an internal transfer with `POST /v2/internal_transfers`. A `200` returns the transfer in `processing`. Lead then debits the core balance behind the sender account number and credits the core balance behind the receiver. This happens within seconds. Lead tells you the outcome with a webhook.

## Prerequisites

Before you send, check these:

* Your token needs the `internal_transfer/read_write` scope.
* Both account numbers must be `active`.
* Both account numbers must point at core balances on different core accounts. Neither can be on a user deposit balance.
* The core balance behind the sender account number must be enabled for internal transfers. Lead sets this at onboarding.
* The sender account number can't be one Lead holds.
* Each account number's [internal transfer controls](https://docs.lead.bank/v2/products/account-number/controls.md#internal-transfers) must permit the other. By default all account numbers are permitted.

## Request requirements

The create request takes these fields and requires an `Idempotency-Key` header. See [Idempotency](https://docs.lead.bank/api-reference/using-the-api/idempotency-v2.md)

| Field | Requirement |
| - | - |
| `sender_account_number_id` | The account number money leaves. |
| `receiver_account_number_id` | The account number money arrives in. |
| `amount` | Amount as an integer in minor units. 5000 is \$50.00. |
| `currency_code` | `USD`. |
| `description` | Your description of the transfer. |

`metadata` is optional. See [The Internal Transfer Object](https://docs.lead.bank/v2/products/internal-transfer/internal-transfer-object.md) for every response field.

```json theme={null}
{
  "sender_account_number_id": "account_number_2fTZ4St5HSJnxzv7jdevxQnev3U",
  "receiver_account_number_id": "account_number_3gUA5Tu6ITKoyAw8kefwyRofw4V",
  "amount": 250000,
  "currency_code": "USD",
  "description": "Daily settlement sweep"
}
```

## Synchronous rejections

Lead checks the following before it accepts the transfer. A failure returns an error and creates no transfer.

| Condition | Result |
| - | - |
| Either account number is on a user deposit balance | The request returns an error. To move money into or out of a user deposit balance, use the user deposit transactions API. |
| Both account numbers resolve to the same core account | The request returns an error. You can't use an internal transfer to move funds between account numbers belonging to the same account. |
| The core balance behind the sender account number doesn't permit internal transfers | `422`. |
| The sender account number is held by Lead | The request returns an error. |

## What you get back

The response includes `sender_core_balance_id` and `receiver_core_balance_id` from the start, so you know which two balances are involved. `sender_core_transaction_id` and `receiver_core_transaction_id` are `null` until the transfer posts.

## Statuses and events

The table lists each status and its webhook.

| Status | Description | Webhook |
| - | - | - |
| `processing` | Lead accepted the transfer and is executing it. | None |
| `posted` | Money moved. Both core transaction IDs are set. Terminal. | `internal_transfer.posted` |
| `rejected` | The transfer did not complete and isn't retried. See `rejection`. Terminal. | `internal_transfer.rejected` |

Treat `processing` as pending. Do not mark the transfer complete until `internal_transfer.posted` arrives. See [Internal Transfer Statuses](https://docs.lead.bank/v2/products/internal-transfer/statuses.md).

## Testing in sandbox

A transfer stays in `processing` until you advance it with `POST /v2/simulate/internal_transfers/{internal_transfer_id}/advance`, naming `posted` or `rejected` in the body.

## Related

* [The Internal Transfer Object](https://docs.lead.bank/v2/products/internal-transfer/internal-transfer-object.md)
* [Internal Transfer Statuses](https://docs.lead.bank/v2/products/internal-transfer/statuses.md)
* [Payment controls](https://docs.lead.bank/v2/products/account-number/controls.md)
