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

# 批量获取虚拟账户状态

此 endpoint 用于检索您之前使用[批量创建虚拟账户](https://docs.localpayment.com/zh/reference/request-batch.md)endpoint 创建的一批虚拟账户的状态和详细信息。这使您可以高效地跟踪多个账户的创建进度并验证其激活状态。


## OpenAPI

````yaml openapi/zh/localpayment.json GET /api/virtual-account-batch/{externalId}
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/virtual-account-batch/{externalId}:
    get:
      summary: 批量获取虚拟账户状态
      operationId: get-virtual-account-status-batch
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。
          required: true
          schema:
            type: string
        - name: externalId
          in: path
          description: 您要查询的批处理进程的唯一标识符。这必须与您通过批处理创建 endpoint 创建批处理时提供的 externalId 值完全一致。
          required: true
          schema:
            type: string
            pattern: '[a-zA-Z0-9\- ]+'
            examples:
              - 53025bf4-4c87-4b4f-8fea-b47004440f37
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalId:
                    type: string
                    description: 此批处理进程的唯一标识符。它与您在请求中提供的 externalId 相同，用于确认您正在查询的批处理操作。
                  internalId:
                    type: string
                    description: Localpayment交易标识符。
                  accountNumber:
                    type: string
                    description: Localpayment账号。
                  status:
                    type: object
                    title: 状态
                    description: 操作状态。
                    properties:
                      code:
                        type: string
                        description: '[状态码](/zh/reference/transaction-status-error-codes)。'
                      description:
                        type: string
                        description: '[状态描述](/zh/reference/transaction-status-error-codes)。'
                        examples:
                          - COMPLETED
                      detail:
                        type: string
                        description: 更多状态信息。
                        examples:
                          - Batch Process Virtual Account completed
                  errors:
                    type: array
                    description: 其他错误信息。
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: 错误代码。
                        detail:
                          type: string
                          description: 错误详情。
                  comment:
                    type: string
                    description: 附加信息。
                  csvFormatResponse:
                    type: string
                    description: >-
                      包含批处理结果的 CSV
                      格式字符串。每一行代表一个已创建的账户，包含以下列：`internal_id`、`external_id` 和
                      `bank_account`。
                x-examples:
                  Example 1:
                    externalId: 0fa6b758-6ada-49d1-9170-7f4ac00c7359
                    internalId: dbc8503a-0c48-4ea9-86fd-d186244bf56e
                    accountNumber: '{{YourAccountNumber}}'
                    status:
                      code: '801'
                      description: REJECTED
                      detail: Batch Process Virtual Account has been rejected
                    errors:
                      - code: '825'
                        detail: System error to generate payin
                    comment: >-
                      The batch process for Virtual Account Creation has been
                      rejected due to errors - The process started at =
                      2025-01-03 22:40:49.99 - Total accounts requested = 12 -
                      Total accounts created = 0 - The process was rejected at =
                      2025-01-03 22:40:50.039 - 
                    csvFormatResponse: |
                      internal_id,external_id,bank_account
              examples:
                200 - Batch Process Virtual Account completed.:
                  value:
                    externalId: ba671d03-b3bc-4312-8841-5c65a67713ca
                    internalId: 91c0de90-9d70-44a6-b9c6-600f835802b6
                    accountNumber: '{{accountNumber}}'
                    status:
                      code: '200'
                      description: COMPLETED
                      detail: Batch Process Virtual Account completed
                    comment: >-
                      The batch process is done - The process started at =
                      2025-01-03 22:59:14.355 - Total accounts requested = 12 -
                      Total accounts created = 12 - The process finished at =
                      2025-01-03 22:59:17.716 - 
                    csvFormatResponse: >
                      internal_id,external_id,bank_account

                      e68208a1-3197-4b1e-82f6-76525a734e56,1111111111-1,646011319800023500

                      80dcc234-1010-427b-b256-3fff18325baf,1111111111-2,646011319800023501

                      d779c2ab-2505-43b8-874c-fcb97a2e5fb7,1111111111-3,646011319800023502

                      afd67163-fd79-4b2c-b288-c4d253bcec57,1111111111-4,646011319800023503

                      01e1d1bb-c89c-4d41-849d-bd1d8e5c3785,1111111111-5,646011319800023504

                      0ba88114-ae62-407b-9f03-8f863000c163,1111111111-6,646011319800023505

                      0184a17a-5c38-4c43-b10a-15079662e518,1111111111-7,646011319800023506

                      b80991f5-396d-485a-b480-fdfb8635bef3,1111111111-8,646011319800023507

                      cd0f6180-c3ad-4a69-815f-25d6f053aee2,1111111111-9,646011319800023608

                      95ea6157-2d17-459c-969a-708ca31cfc13,1111111111-10,646011319800023609

                      cf50e4d2-ac34-48f4-a60f-b2ee8b152f6a,1111111111-11,646011319800023610

                      70d1f0be-3db0-48fd-8493-b712038ea48e,1111111111-12,646011319800023611
                801 - Batch Process Virtual Account has been rejected.:
                  value:
                    externalId: bbeb7535-601c-4671-9966-13146e94cc65
                    internalId: 1f9662f5-bf16-4f65-8229-c09b3b41fc26
                    accountNumber: '{{accountNumber}}'
                    status:
                      code: '801'
                      description: REJECTED
                      detail: Batch Process Virtual Account has been rejected
                    errors:
                      - code: '812'
                        detail: External Id already used - duplication
                    comment: >-
                      The batch process for Virtual Account Creation has been
                      rejected due to errors - The process started at =
                      2025-01-03 23:10:03.715 - Total accounts requested = 12 -
                      Total accounts created = 0 - The process was rejected at =
                      2025-01-03 23:10:03.757 - 
                    csvFormatResponse: |
                      internal_id,external_id,bank_account
        '400':
          description: 错误的请求。
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: 服务执行时间。
                  status:
                    type: integer
                    description: 错误状态码。
                  error:
                    type: string
                    description: 错误描述。
                  message:
                    type: string
                    description: 包含补充信息的消息。
                  path:
                    type: string
                    description: 服务路径。
                x-examples:
                  Example 1:
                    timestamp: '2025-01-03T23:11:24.655+00:00'
                    status: 400
                    error: Bad Request.
                    message: >-
                      Batch external id not found:
                      bbeb7535-607c-4671-9966-13146e94cc6511
                    path: >-
                      /virtual-account/batch/bbeb7535-607c-4671-9966-13146e94cc6511
              examples:
                400 - Batch external id not found.:
                  value:
                    timestamp: '2025-01-03T23:11:24.655+00:00'
                    status: 400
                    error: Bad Request.
                    message: >-
                      Batch external id not found:
                      bbe17535-607c-4621-9966-13146494cc6511
                    path: >-
                      /virtual-account/batch/bbe17535-607c-4621-9966-13146494cc6511
        '401':
          description: 未经授权。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 回复的补充信息。
                  code:
                    type: string
                    description: 状态码。
                  messages:
                    type: array
                    description: 消息列表。
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token 类。
                        token_type:
                          type: string
                          description: 令牌类型。
                        message:
                          type: string
                          description: 包含补充信息的消息。
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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