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

# 删除虚拟账户

永久停用虚拟账户。此操作将阻止该账户接收任何未来的付款，但其所有历史记录和交易数据将保留，以用于合规性和对账。

**重要提示：** 此操作不可逆。已删除的账户无法重新激活。如果您需要恢复为同一收款人收款，则必须创建一个新的虚拟账户。


## OpenAPI

````yaml openapi/zh/localpayment.json DELETE /api/virtual-account/{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/{externalId}:
    delete:
      summary: 删除虚拟账户
      operationId: delete-virtual-account
      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: >-
            您要管理的虚拟帐户的唯一标识符。此标识符必须与您创建帐户时提供的 externalId
            值完全一致。使用此标识符可以指定目标帐户，以便执行诸如检索帐户状态或删除帐户等操作。
          required: true
          schema:
            type: string
            pattern: '[a-zA-Z0-9\- ]+'
            examples:
              - 9c590364-b6b4-116b-cf09-d63e8681c8fc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  currency:
                    type: string
                    enum:
                      - ARS
                      - BRL
                      - CLP
                      - USD
                      - MXN
                      - PEN
                    description: '[货币代码](/zh/reference/currency-codes)。'
                  externalId:
                    type: string
                    description: 虚拟账户的唯一标识符。这与您请求中提供的 externalId 相同，确认已对正确的账户执行了停用操作。
                  internalId:
                    type: string
                    description: Localpayment交易标识符。
                  accountNumber:
                    type: string
                    description: Localpayment账号。
                  beneficiary:
                    type: object
                    title: 受益人
                    description: 接收存入此虚拟账户资金的个人或实体。受益人是资金的最终接收者，但不一定是虚拟账户本身的合法所有者或持有人。
                    properties:
                      type:
                        type: string
                        enum:
                          - COMPANY
                          - INDIVIDUAL
                        description: 受益人类型。
                      name:
                        type: string
                        description: 受益人姓名。
                      document:
                        type: object
                        description: 受益人文件。
                        properties:
                          type:
                            type: string
                            description: >-
                              根据签发国家/地区的不同，[身份证明文件类型](/zh/reference/identity-document-types)可能包括国民身份证号码、社会保障号码或驾驶执照。
                            examples:
                              - RUC
                          id:
                            type: string
                            description: 身份证件号码（通常为数字）。该号码必须符合特定证件类型的有效规定。
                            examples:
                              - '1791234561009'
                        examples:
                          - type: RUC
                            id: '1791234561009'
                      lastName:
                        type: string
                        description: 受益人的姓氏。
                      fullName:
                        type: string
                        description: 受益人全名。
                      bank:
                        type: object
                        properties:
                          branch:
                            type: object
                            description: 银行网点详细信息。
                            properties:
                              code:
                                type: string
                                description: 分行代码。
                          account:
                            type: object
                            description: 受益人银行账户详情。
                            properties:
                              number:
                                type: string
                                description: 账号。
                              aliases:
                                type: array
                                description: 账户别名数组（例如账户的唯一标识符）。
                                items:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      description: 别名的类型（例如 `RandomKeyCode`）。
                                    value:
                                      type: string
                                      description: 别名值。
                              owner:
                                type: object
                                description: 账户所有人的证件详细信息。
                                properties:
                                  document:
                                    type: object
                    examples:
                      - type: COMPANY
                        name: string
                        document:
                          type: RUC
                          id: '1791234561009'
                        lastName: string
                        fullName: string
                        bank:
                          branch: {}
                          account:
                            number: string
                            aliases:
                              - type: string
                                value: string
                            owner:
                              document: {}
                  status:
                    $ref: '#/components/schemas/status'
                  errors:
                    type: array
                    description: 交易过程中发生的错误数组。如果交易成功，则此数组为空。
                    items:
                      type: object
                x-examples:
                  Example 1:
                    currency: MXN
                    externalId: a79aacec-d616-4d84-8abe-be2dcd2e07a1
                    internalId: d710812c-803f-4b65-8e62-7f83eeba321a
                    accountNumber: '{{accountNumber}}'
                    beneficiary:
                      type: INDIVIDUAL
                      name: FirtName
                      document:
                        type: RFC
                        id: EXTF900101NI1
                      bank:
                        branch: {}
                        account:
                          number: '646011319800023790'
                          aliases: []
                          owner:
                            document: {}
                      fullName: FirtName LastName
                      lastName: LastName
                    status:
                      code: '100'
                      description: INPROGRESS
                      detail: Virtual account in progress
                    errors: []
              examples:
                100 - Virtual account in progress:
                  value:
                    currency: MXN
                    externalId: a79aabec-16c6-4a84-8abe-be2dcd2e07a1
                    internalId: d710312c-8c3f-4b65-8e62-7f83eeba321a
                    accountNumber: '{{yourLocalpaymentAccountNumber}}'
                    beneficiary:
                      type: INDIVIDUAL
                      name: Zhang
                      document:
                        type: RFC
                        id: EXTF900101NI1
                      bank:
                        branch: {}
                        account:
                          number: '646011319800023123'
                          aliases: []
                          owner:
                            document: {}
                      fullName: Zhang Wei
                      lastName: Wei
                    status:
                      code: '100'
                      description: INPROGRESS
                      detail: Virtual account in progress
                    errors: []
        '400':
          description: 错误的请求。
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: 状态码。
                      detail:
                        type: string
                        description: 更多回复详情。
                    required:
                      - code
                      - detail
                required:
                  - status
                x-examples:
                  Example 1:
                    status:
                      code: '400'
                      detail: Virtual account not found
              examples:
                400 - Invalid operation.:
                  value:
                    status:
                      code: '400'
                      detail: Invalid operation
                400 - Virtual account not found.:
                  value:
                    status:
                      code: '400'
                      detail: Virtual account not found
        '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:
  schemas:
    status:
      type: object
      title: 状态
      description: 操作状态。
      properties:
        code:
          type: string
          description: 状态码。
        description:
          type: string
          description: 状态描述。
        detail:
          type: string
          description: 更多状态信息。
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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