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

# 创建内部出款

> 向另一个 UQPAY 账户发起同币种法币出款。`account_id` 填写收款账户；通过 `x-on-behalf-of` 可指定已授权的子账户付款。不支持向实际付款账户自身转账。

付款账户须已开通内部出款能力。资金来源与余额要求见 `with_transfer`。

提交后，使用返回的出款 ID 和相同付款账户[查询出款详情](/zh/global-account/v1.6/api-reference/retrieve-payout)，确认出款状态。



## OpenAPI

````yaml /zh/global-account/v1.6/banking.yaml post /v1/payouts/intra
openapi: 3.0.2
info:
  title: Banking API
  version: 0.0.1
  x-source-en-commit: 4babb15
  x-source-en-path: global-account/v1.6/banking.yaml
  description: |
    UQPAY Banking API 为全球资金流转提供完整的银行与支付解决方案。

    ## 核心功能
    - 国际支付与转账
    - 多币种账户管理
    - 实时换汇
    - 虚拟账户服务
    - 资金充值与提现

    ## 认证
    调用 UQPAY API 时，使用 API 密钥对客户端请求进行认证。
    API 密钥是用于认证用户身份、授予特权操作访问权限的唯一数据字符串。
    请始终对 API 密钥保密并妥善保管。

    ## 服务组件
    - **Payout**：创建并管理向受益人发起的国际资金转账
    - **Payer**：管理发起付款并授权资金转账的实体
    - **Beneficiary**：管理收款方信息与银行信息
    - **Balance**：查看并管理多币种账户余额
    - **Deposit**：处理入账资金转账
    - **Virtual Accounts**：使用外币本地银行账户
    - **Conversion**：以有竞争力的汇率执行换汇

    ## 快速开始
    1. 获取 API 凭证
    2. 使用 sandbox URL 搭建测试环境
    3. 接入认证
    4. 从基础操作开始

    ## 支持
    如需技术支持与集成协助，请联系 UQPAY 支持团队。
  contact:
    name: UQPAY Support
    url: https://www.uqpay.com/support
    email: banking.tech@uqpay.com
  license:
    name: Proprietary
    url: https://www.uqpay.com/legal/api-terms
  termsOfService: https://www.uqpay.com/legal/terms
  x-api-id: banking-api-v1.6.0
  x-logo:
    url: https://uqpay.com/img/UQPAY_LogoAnimv2.gif
    backgroundColor: '#FFFFFF'
    altText: UQPAY Logo
  x-categories:
    - Banking
    - Payment Processing
    - Foreign Exchange
servers:
  - url: https://api-sandbox.uqpaytech.com/api
    description: Sandbox 基础 URL。
  - url: https://api.uqpay.com/api
    description: 生产环境基础 URL。
security: []
tags:
  - name: Balances
    description: 查看并管理账户中不同币种的可用资金。
  - name: Transfers
    description: 钱包转账资源用于将资金从你的 UQPAY 账户直接转入关联账户。
  - name: Deposits
    description: 充值是指向你的 UQPAY 全球收款账户发起的银行转账，用于补充资金或从第三方收款。
  - name: Virtual Accounts
    description: 虚拟账户是以外币形式存在的本地银行账户。它们支持全球收款，提供可从各类平台收款的账户信息。虚拟账户也可用于为 UQPAY 余额充值。
  - name: Payout
    description: >-
      当你向受益人发起付款时会创建一个 Payout
      资源。它记录受益人、银行信息、付款金额、状态及其他相关信息。你可以使用直接填写的受益人信息，或使用先前创建的受益人 ID 来创建 payout。
  - name: Beneficiaries
    description: 受益人是资金的收款方，通常也是最终从 payout 中获益的一方。
  - name: Conversion
    description: 管理交易的换汇与汇率。
  - name: Exchange Rates
    description: 获取指定货币对或全部可用货币对的实时汇率。
  - name: Global Accounts
    description: ⚠️ 警告 此 API 版本已弃用。已弃用的 API 版本最终将不再受支持。全球收款账户是充当本地银行账户的外币账户。
  - name: Simulator
    description: 在 sandbox 环境中模拟充值交易。
paths:
  /v1/payouts/intra:
    post:
      tags:
        - Payouts
      summary: 创建内部出款
      description: >-
        向另一个 UQPAY 账户发起同币种法币出款。`account_id` 填写收款账户；通过 `x-on-behalf-of`
        可指定已授权的子账户付款。不支持向实际付款账户自身转账。


        付款账户须已开通内部出款能力。资金来源与余额要求见 `with_transfer`。


        提交后，使用返回的出款 ID
        和相同付款账户[查询出款详情](/zh/global-account/v1.6/api-reference/retrieve-payout)，确认出款状态。
      operationId: create-internal-payout
      parameters:
        - name: x-on-behalf-of
          in: header
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            指定代表哪个已授权的直属子账户发起请求。填写该子账户的 `account_id`（小写
            UUID），可通过[查询关联账户列表](/zh/account-center/v1.6/api-reference/list-connected-accounts)获取。省略时使用
            Token 对应账户。

            更多信息参见[关联账户](/zh/account-center/v1.6/guide/connected-accounts)。
        - name: x-idempotency-key
          in: header
          required: true
          schema:
            type: string
            format: uuid
          description: 用于保证请求幂等性的唯一标识符（小写 UUID）。同一操作重试时使用相同标识符，避免重复出款。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InternalPayoutCreationRequest'
            examples:
              sandbox:
                summary: Sandbox 请求
                description: 使用付款账户余额出款。请将 `account_id` 替换为你的收款账户。
                value:
                  account_id: CB5168811008
                  currency: USD
                  amount: '0.01'
                  purpose_code: business_expenses
                  payout_reference: INTRA-CONTRACT-20261020-01
      responses:
        '200':
          description: 出款已受理，请查询出款详情确认完成状态。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalPayoutCreationResponse'
              examples:
                sandbox:
                  summary: Sandbox 响应
                  value:
                    payout_id: d2696076-257d-4da3-858d-c1499d540bb3
                    short_reference_id: PT261020-Y4BU5K4E
                    payout_status: READY_TO_SEND
        '400':
          description: 参数无效、账户或服务不可用、余额不足或幂等冲突。
        '409':
          description: 请求处理中，稍后使用原 Key 和原请求重试。
      security:
        - XAuthToken: []
components:
  schemas:
    InternalPayoutCreationRequest:
      type: object
      required:
        - account_id
        - currency
        - amount
        - purpose_code
      properties:
        account_id:
          type: string
          description: 收款目标账户的 UUID 或短号。目标须已激活、具有账户短号，且不能是实际付款账户自身。不支持邮箱。
          maxLength: 36
        currency:
          type: string
          description: >-
            出款币种，使用三位字母 [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
            币种代码。须为收付双方账户支持的同一法币币种。
          minLength: 3
          maxLength: 3
        amount:
          type: string
          description: 出款金额，不含手续费，须大于零。IDR、JPY 和 KRW 的出款金额须为整数。
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
        purpose_code:
          type: string
          description: |-
            出款用途，不区分大小写，不应带首尾空白。请按实际业务选择以下支持的用途码：

            | 用途码 | 中文释义 |
            | --- | --- |
            | `audio_visual_services` | 视听服务 |
            | `bill_payment` | 账单支付 |
            | `business_expenses` | 商业费用 |
            | `construction` | 建筑施工 |
            | `donation_charitable_contribution` | 慈善捐赠 |
            | `education_training` | 教育培训 |
            | `family_support` | 家庭支持 |
            | `freight` | 运费 |
            | `goods_purchased` | 购买商品 |
            | `investment_capital` | 投资本金 |
            | `investment_proceeds` | 投资收益 |
            | `living_expenses` | 生活费用 |
            | `loan_credit_repayment` | 贷款或信贷还款 |
            | `medical_services` | 医疗服务 |
            | `pension` | 养老金 |
            | `personal_remittance` | 个人汇款 |
            | `professional_business_services` | 专业商业服务 |
            | `real_estate` | 房地产 |
            | `taxes` | 税费 |
            | `technical_services` | 技术服务 |
            | `transfer_to_own_account` | 转入本人账户 |
            | `travel` | 旅行 |
            | `wages_salary` | 工资薪酬 |
          maxLength: 200
        nickname:
          type: string
          description: 收款人昵称。
          maxLength: 120
        payout_reason:
          type: string
          description: 出款用途的补充说明。
          maxLength: 200
        payout_reference:
          type: string
          description: 用于关联业务的出款附言。
          maxLength: 100
        with_transfer:
          type: string
          description: >-
            是否在子账户付款前，先由其主账户划入本次付款所需资金。


            使用主账户 Token 时，默认由主账户付款；携带 `x-on-behalf-of` 时，由指定的子账户付款。`account_id`
            始终填写最终收款账户。


            - **`N` 或省略：直接使用付款账户余额。** 资金流向为 **付款账户 → 收款账户**。付款账户可用余额须覆盖 `amount`
            和出款手续费；余额不足时失败，不会自动从主账户划款。

            - **`Y`，由子账户付款：先从主账户划款，再由子账户付款。** 资金流向为 **主账户 → 付款子账户 →
            收款账户**。主账户先向子账户划入 `amount` 加出款手续费，再由子账户完成付款。即使子账户已有足够余额，也会划入这笔全额资金。


            使用 `Y` 为子账户付款时，**主账户总扣款 = `amount` + 出款手续费 +
            主子账户划转手续费**。主账户可用余额不足时失败，不会改用子账户已有余额。


            如果实际付款账户是主账户，`Y` 与 `N` 的处理相同：直接使用该主账户的余额付款。


            使用主账户供资时，付款子账户须直属于该主账户，并已开通此能力；出款币种的余额账户须有效，且可用余额不能为负。开通请联系 UQPAY。
          enum:
            - 'Y'
            - 'N'
        documentation:
          type: array
          description: 证明材料，每项使用 `file_id` 或 `file` 提供。
          items:
            type: object
            properties:
              file_id:
                type: string
                description: 已上传文件的公开 ID。
              file:
                type: string
                description: 将文件内容进行 Base64 编码并包含 Data URI 前缀。支持 PDF、JPEG/JPG 和 PNG。
    InternalPayoutCreationResponse:
      type: object
      properties:
        payout_id:
          type: string
          description: 出款的唯一标识。
          format: uuid
        short_reference_id:
          type: string
          description: 出款短流水号。
        payout_status:
          type: string
          description: |-
            - `READY_TO_SEND`: 已受理，等待处理。
            - `PENDING`: 处理中。
            - `COMPLETED`: 已完成。
            - `FAILED`: 失败或取消。
            - `REJECTED`: 审核拒绝。
          enum:
            - READY_TO_SEND
            - PENDING
            - COMPLETED
            - FAILED
            - REJECTED
  securitySchemes:
    XAuthToken:
      type: apiKey
      in: header
      name: x-auth-token
      description: 由 UQPAY 提供的登录 API Token。

````

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