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

# 内部境内转账

在您的 Localpayment 账户之间进行安全的内部转账。保持流动性，并在无需货币兑换的情况下管理境内资金。

内部境内转账允许您在同一国家/地区、同一货币的 Localpayment 账户之间安全地转移资金。此功能非常适合在多个账户之间管理流动性，或为提高运营效率而重新分配资金。

## 用例

* **投资组合再平衡：** 在客户投资组合之间动态重新配置资金，以迅速把握市场变动并遵守战略投资授权。
* **集中流动性管理：** 整合各运营账户的余额，以优化营运资金、确保及时付款并最大限度地利用资金。
* **结构化资金分配：** 从中央账户自动向各部门、项目或成本中心拨付预算，同时保持完全的可见性和控制权。
* **监管与风险合规：** 通过在指定账户类型之间划分资金，主动管理资本储备和风险缓冲，以满足监管要求和内部政策。

***

## 先决条件

在发起内部境内转账之前，请确保您已具备：

* 您的来源账户中有**足够的资金**
* 具有内部转账权限的**有效 API 凭据**
* 来源账户和目标账户均已完成**账户验证**
* 两个账户均在**同一国家/地区**注册

> [!WARNING]
>
> **重要**
>
> 两个账户必须在同一国家/地区注册。

***

## API 集成

要创建内部境内转账，请向[创建内部转账](https://docs.localpayment.com/zh/reference/domestic-transfer.md)endpoint 发送 `POST` 请求。

### endpoint

```http theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
POST https://api.stage.localpayment.com/api/internal-transfer
```

### 验证

```http theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
Authorization: Bearer <your_access_token>
```

### 关键请求参数

| 参数 | 类型 | 描述 |
| - | - | - |
| `externalId` | string | 您的唯一交易标识符 |
| `country` | string | ISO alpha-3 国家代码 |
| `currency` | string | ISO 货币代码 |
| `amount` | number | 转账金额 |
| `transactionType` | string | 必须为 "InternalDomesticTransfer" |
| `client.from.accountNumber` | string | 来源账号 |
| `client.to.accountNumber` | string | 目标账号 |

### 请求示例

```bash curl theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
curl --request POST \
      --url https://api.stage.localpayment.com/api/internal-transfer \
      --header 'Authorization: Bearer <your_access_token>' \
      --header 'Accept: application/json' \
      --header 'Content-Type: application/json' \
      --data '{
        "externalId": "8888ad65-aa6e-4643-b9ba-ff62318fd90b",
        "country": "ARG",
        "currency": "ARS",
        "amount": 1000,
        "transactionType": "InternalDomesticTransfer",
        "client": {
          "type": "Client",
          "from": {
            "accountNumber": "{{accountNumber}}"
          },
          "to": {
            "accountNumber": "{{accountNumber}}"
          }
        }
      }'
```

***

## 响应处理

我们的 API 提供全面的响应数据，以便有效地管理交易和进行对账。

### 成功响应

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
    "transactionType": "InternalDomesticTransfer",
    "externalId": "8888ad65-aa6e-4643-b9ba-ff62318fd90b",
    "internalId": "cda1c606-a14f-4cab-a323-82c09f2ca8b1",
    "country": "ARG",
    "currency": "ARS",
    "clientCode": "0001",
    "creationDate": "2025-10-14T15:44:53.374+00:00",
    "errors": [],
    "status": {
        "code": "200",
        "description": "Completed",
        "detail": "INTERNAL TRANSFER"
    },
    "amount": 1000,
    "client": {
        "type": "Client",
        "from": {
            "clientCode": "0001",
            "accountNumber": "{{accountNumber}}"
        },
        "to": {
            "clientCode": "0001",
            "accountNumber": "{{accountNumber}}",
            "amount": 966.0
        }
    },
    "fees": {
        "description": "Fee",
        "currency": "ARS",
        "amount": 21.0,
        "account": "{{accountNumber}}"
    },
    "localTaxes": [
        {
            "code": "0001",
            "percentage": 1.3,
            "description": "IDC",
            "currency": "ARS",
            "fxSource": 1360.092976,
            "fxQuote": 0.0,
            "amount": 13.0,
            "account": "{{accountNumber}}"
        }
    ],
    "withHoldings": [],
    "code": "200"
}
```

#### 关键响应字段

| 字段 | 描述 |
| - | - |
| `internalId` | 系统生成的用于跟踪的唯一标识符 |
| `status.code` | 交易状态：200（COMPLETED），702+（ERRORS） |
| `client.to.amount` | 记入目标账户的净金额 |
| `fees.amount` | 扣除的处理费用总额 |
| `localTaxes` | 适用的地方税数组 |
| `payment.creditedAmount` | 目标账户最终收到的金额 |

### 错误响应

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
    {
      "externalId": "TXN_INVALID_123",
      "internalId": "fc2c831c-d0f1-41f6-8a59-0ecd426c087d",
      "errors": [
        {
          "code": "702",
          "detail": "Account not configured for InternalDomesticTransfer"
        },
        {
          "code": "703", 
          "detail": "Account countries must match"
        },
        {
          "code": "704",
          "detail": "Insufficient funds in source account"
        }
      ],
      "status": {
        "code": "702",
        "description": "REJECTED",
        "detail": "Configuration validation failed"
      }
    }
```

***

## 交易状态跟踪

通过多种渠道监控您的货币兑换情况：

> [card] [Webhooks（推荐）](https://docs.localpayment.com/zh/docs/webhooks.md)
>
> 交易状态变更时接收实时通知。最适用于生产环境。

> [card] [状态 API endpoint](https://docs.localpayment.com/zh/reference/get-transaction-status.md)
>
> 以编程方式查询事务状态。可用于轮询或恢复丢失的 webhook 通知。

> [card] [Business Portal 视图](https://docs.localpayment.com/zh/docs/dashboard-overview.md)
>
> 用于监控交易的可视化界面。非常适合人工监督和详细的交易分析。

### 状态生命周期

| 代码 | 状态 | 描述 |
| :- | :- | :- |
| `100` | `InProgress` | 进行中 |
| `102` | `PendingDebit` | 待借记 |
| `103` | `PendingCredit` | 待贷记 |
| `200` | `Completed` | 内部转账 |
| `303` | `Rejected` | 此汇率代币已过期。 |

> [!NOTE]
>
> **完整参考**
>
> 请查看我们的[交易状态文档](https://docs.localpayment.com/zh/reference/transaction-status-error-codes)，了解所有状态代码。

***

## 资源与后续步骤

利用这些关键资源，最大限度地提高您的集成成功率。

> [card] [Webhook 集成](https://docs.localpayment.com/zh/docs/webhooks.md)
>
> 设置交易状态更新的实时通知。

> [card] [报告 Business Portal](https://docs.localpayment.com/zh/docs/balance-report.md)
>
> 获取详细的分析、报告工具和对账功能。

> [card] [交易监控](https://docs.localpayment.com/zh/reference/transaction-status-error-codes)
>
> 学习查询交易状态并实现全面跟踪。

> [card] [API 参考](https://docs.localpayment.com/zh/reference/exchange-bulk.md)
>
> 提供包含交互式示例的完整 endpoint 文档。

> [!NOTE]
>
> **专业提示**
>
> 在部署到生产环境之前，务必先在我们的沙盒环境中测试您的工作流程。这可以确保您的错误处理、Webhook 处理和状态跟踪在所有场景下都能正常工作。

***

> [!NOTE]
>
> **需要帮助吗？**
>
> 如果您遇到任何问题或需要集成方面的帮助，请联系我们的[支持团队](mailto:support@localpayment.com)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.