> ## 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.

# Retrieve Virtual Account Application

> 返回属于当前认证账户的最新申请详情。查询子账户申请时，请在 `x-on-behalf-of` 中传入对应的账户 ID。

使用 `application_id` 标识申请，并通过 `public_version` 忽略较旧的响应或 Webhook 事件。申请不存在和申请属于其他账户时，均返回相同的 HTTP `400` 错误。

轮询、Webhook 补偿和状态处理详见[通过 API 集成虚拟账户](/zh/global-account/v1.6/guide/virtual-account-api-lifecycle)。




## OpenAPI

````yaml /zh/global-account/v1.6/banking.yaml get /v1/virtual/applications/{application_id}
openapi: 3.0.2
info:
  title: Banking API
  version: 0.0.1
  x-source-en-commit: c7d2fd6
  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/virtual/applications/{application_id}:
    get:
      tags:
        - Virtual Accounts
      summary: Retrieve Virtual Account Application
      description: >
        返回属于当前认证账户的最新申请详情。查询子账户申请时，请在 `x-on-behalf-of` 中传入对应的账户 ID。


        使用 `application_id` 标识申请，并通过 `public_version` 忽略较旧的响应或 Webhook
        事件。申请不存在和申请属于其他账户时，均返回相同的 HTTP `400` 错误。


        轮询、Webhook 补偿和状态处理详见[通过 API
        集成虚拟账户](/zh/global-account/v1.6/guide/virtual-account-api-lifecycle)。
      operationId: retrieve-virtual-account-application
      parameters:
        - $ref: '#/components/parameters/XOnBehalfOf'
        - $ref: '#/components/parameters/VirtualAccountApplicationId'
      responses:
        '200':
          description: OK —— 虚拟账户申请返回成功。
          headers:
            x-response-id:
              $ref: '#/components/headers/XResponseId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountApplicationResponse'
                title: RetrieveVirtualAccountApplicationResponse
              examples:
                submitted:
                  summary: 申请仍在处理中
                  value:
                    data:
                      account_id: b1b89684-c2c4-4d54-b8a8-3572727fd120
                      application_id: 550e8400-e29b-41d4-a716-446655440001
                      country: BH
                      currency: EUR
                      direct_id: '0'
                      public_version: 1
                      status: SUBMITTED
                      results:
                        - payment_method: SWIFT
                          status: SUBMITTED
                          virtual_accounts: []
                          error: null
                completed:
                  summary: 虚拟账户银行信息已可用
                  value:
                    data:
                      account_id: b1b89684-c2c4-4d54-b8a8-3572727fd120
                      application_id: 7bd8df2d-4975-4c1a-a956-66af2a6dbed8
                      country: BH
                      currency: GBP
                      direct_id: '0'
                      public_version: 2
                      status: COMPLETED
                      results:
                        - payment_method: SWIFT
                          status: COMPLETED
                          virtual_accounts:
                            - account_bank_id: va-bank-detail-001
                              account_holder: Example Merchant Ltd.
                              account_number: BH00SGBD00000000000000
                              country_code: BH
                              currency: GBP
                              bank_name: Singapore Gulf Bank
                              bank_address: Manama, Bahrain
                              clearing_system:
                                type: bic_swift
                                value: SGBDBHB2XXX
                              status: ACTIVE
                              close_reason: ''
                          error: null
                closed:
                  summary: 所有已开通虚拟账户均已关闭
                  value:
                    data:
                      account_id: b1b89684-c2c4-4d54-b8a8-3572727fd120
                      application_id: 8f05cb15-b3ea-4c8f-b10d-4376e6355037
                      country: BH
                      currency: GBP
                      direct_id: '0'
                      public_version: 3
                      status: CLOSED
                      results:
                        - payment_method: SWIFT
                          status: CLOSED
                          virtual_accounts:
                            - account_bank_id: va-bank-detail-001
                              account_holder: Example Merchant Ltd.
                              account_number: BH00SGBD00000000000000
                              country_code: BH
                              currency: GBP
                              bank_name: Singapore Gulf Bank
                              bank_address: Manama, Bahrain
                              clearing_system:
                                type: bic_swift
                                value: SGBDBHB2XXX
                              status: CLOSED
                              close_reason: ''
                          error: null
        '400':
          description: Bad Request —— 申请不存在或不属于当前认证账户。
          headers:
            x-response-id:
              $ref: '#/components/headers/XResponseId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountApplicationErrorResponse'
                title: VirtualAccountApplicationNotFound
              example:
                type: not_found
                code: virtual_account_application_not_found
                message: Virtual account application not found
      security:
        - XAuthToken: []
components:
  parameters:
    XOnBehalfOf:
      in: header
      name: x-on-behalf-of
      schema:
        type: string
      required: false
      description: >
        指定代表哪个子账户发起请求。应设为
        `account_id`，可通过[查询关联账户列表](/zh/account-center/v1.6/api-reference/list-connected-accounts-1)获取。如果省略或留空，请求将使用主账户执行。

        更多信息参见[关联账户](/zh/account-center/v1.6/guide/connected-accounts)。
      example: 18523f72-f4de-4f9c-bb8e-ec7d1c4f32be
    VirtualAccountApplicationId:
      name: application_id
      in: path
      required: true
      description: Create Virtual Account 或 application Webhook 返回的申请标识符。
      schema:
        type: string
        format: uuid
      example: 550e8400-e29b-41d4-a716-446655440001
  headers:
    XResponseId:
      description: 响应的通用唯一标识符（UUID v4）。在与 UQPAY 支持团队沟通时有助于定位某个请求。
      schema:
        type: string
        format: uuid
        example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
  schemas:
    VirtualAccountApplicationResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/VirtualAccountApplication'
    VirtualAccountApplicationErrorResponse:
      type: object
      additionalProperties: false
      required:
        - type
        - code
        - message
      properties:
        type:
          type: string
          description: 用于分类和日志记录的错误大类。
          example: invalid_request_error
        code:
          type: string
          description: 用于程序处理的稳定错误标识符。
          example: invalid_parameter
        message:
          type: string
          description: 供排查问题使用的可读说明。不要将该文本作为程序判断标识符。
          example: country must be a valid ISO-2 code
    VirtualAccountApplication:
      type: object
      additionalProperties: false
      required:
        - account_id
        - application_id
        - country
        - currency
        - direct_id
        - public_version
        - results
        - status
      properties:
        account_id:
          type: string
          format: uuid
          description: 申请所属账户。使用 `x-on-behalf-of` 时表示该关联账户；否则表示主账户。
          example: b1b89684-c2c4-4d54-b8a8-3572727fd120
        application_id:
          type: string
          format: uuid
          description: 这笔申请的标识符。Create 成功后请保存该值，用于查询详情和关联 Webhook 事件。
          example: 550e8400-e29b-41d4-a716-446655440001
        country:
          type: string
          description: Create 请求中提交的两位国家代码。每条已开通银行信息还会返回自己的 `country_code`。
          example: BH
        currency:
          type: string
          description: Create 请求中提交的三位币种代码。
          example: EUR
        direct_id:
          type: string
          description: 表示 `account_id` 的主账户关系。当 `account_id` 是主账户时为 `"0"`；否则为对应主账户 ID。
          example: '0'
        public_version:
          type: integer
          format: int64
          minimum: 1
          description: 返回的申请数据版本。初始值为 `1`，返回数据变化时递增。对于同一 `application_id`，保留版本号最高的响应或事件。
          example: 1
        status:
          type: string
          enum:
            - SUBMITTED
            - PARTIALLY_COMPLETED
            - COMPLETED
            - FAILED
            - CLOSED
          description: 这笔申请的整体状态。该字段用于跟踪申请；判断银行信息是否可用前，仍需检查每个结果和银行信息的状态。各状态含义详见接入指南。
          example: SUBMITTED
        results:
          type: array
          minItems: 1
          maxItems: 2
          description: >-
            每种已评估收款方式对应一项结果。请逐项处理并通过 `payment_method` 识别。两种方式同时存在时，`LOCAL` 排在
            `SWIFT` 之前。
          items:
            $ref: '#/components/schemas/VirtualAccountApplicationResult'
    VirtualAccountApplicationResult:
      type: object
      additionalProperties: false
      required:
        - payment_method
        - status
        - virtual_accounts
        - error
      properties:
        payment_method:
          type: string
          enum:
            - LOCAL
            - SWIFT
          description: 这项结果对应的收款方式。`LOCAL` 使用受支持的本地清算网络；`SWIFT` 使用 SWIFT 网络。
          example: SWIFT
        status:
          type: string
          enum:
            - SUBMITTED
            - COMPLETED
            - FAILED
            - SKIPPED
            - CLOSED
          description: >-
            这项收款方式的状态。只有当该值为 `COMPLETED` 且具体银行信息状态为 `ACTIVE`
            时，才能使用相应银行信息。各状态的处理方式详见接入指南。
          example: SUBMITTED
        virtual_accounts:
          type: array
          description: 这项收款方式下已开通的银行信息。空数组表示该结果下没有已开通信息。只能使用 `status` 为 `ACTIVE` 的记录。
          items:
            $ref: '#/components/schemas/VirtualAccountApplicationBankDetail'
        error:
          type: object
          nullable: true
          additionalProperties: false
          required:
            - code
            - message
          description: 这项收款方式被跳过或失败时的错误；没有错误时为 `null`。程序处理应使用 `code`。
          properties:
            code:
              type: string
              description: 用于程序处理的稳定错误代码。支持的代码和建议操作详见接入指南。
              example: VA_METHOD_NOT_SUPPORTED
            message:
              type: string
              description: 供排查问题使用的可读说明。不要将该文本用作程序判断依据。
              example: LOCAL is not supported for the requested country and currency
    VirtualAccountApplicationBankDetail:
      type: object
      additionalProperties: false
      required:
        - account_bank_id
        - account_holder
        - account_number
        - country_code
        - currency
        - bank_name
        - bank_address
        - clearing_system
        - status
        - close_reason
      properties:
        account_bank_id:
          type: string
          description: 这条银行信息的稳定标识符。请将其视为不透明字符串并按原值保存，用于关联后续变化。
          example: va-bank-detail-001
        account_holder:
          type: string
          description: 向付款人展示的账户持有人名称，应按返回值原样使用。
          example: John Doe
        account_number:
          type: string
          description: 付款人转账时必须使用的账号或 IBAN。请保留格式和前导零。
          example: '12345678'
        country_code:
          type: string
          description: 此已开通银行账户的两位国家代码。生成付款指引时使用该返回值，不要仅根据 application 推断。
          example: SG
        currency:
          type: string
          description: 此银行信息可以接收的三位币种代码。应要求付款人仅发送该币种。
          example: USD
        bank_name:
          type: string
          description: 付款指引中应包含的银行名称。
          example: ABC Bank
        bank_address:
          type: string
          description: 付款人银行或转账表单要求时应填写的银行地址。
          example: 810 Seventh Avenue, New York, NY 10019, US
        clearing_system:
          type: object
          additionalProperties: false
          required:
            - type
            - value
          description: 此银行信息所需的路由标识。`type` 和 `value` 必须配套使用，并按返回值原样保留。
          properties:
            type:
              type: string
              description: 路由标识的格式或网络，例如 `bic_swift`。
              example: bic_swift
            value:
              type: string
              description: 与 `type` 对应的路由标识值，例如 BIC/SWIFT 代码或本地清算代码。
              example: TCCLGB3L
        status:
          type: string
          enum:
            - ACTIVE
            - CLOSED
          description: 该银行信息是否可用。`ACTIVE` 可用于新的付款指引；`CLOSED` 不得继续展示或使用。
          example: ACTIVE
        close_reason:
          type: string
          example: ''
          description: >-
            始终存在的 string 字段。除 `status = CLOSED` 外始终为
            `""`。记录关闭后，如系统已记录关闭原因则返回该值，否则仍为 `""`。请使用 `status`
            判断银行信息是否已关闭，不要依赖该字段。
  securitySchemes:
    XAuthToken:
      type: apiKey
      in: header
      name: x-auth-token
      description: 由 UQPAY 提供的登录 API Token。

````