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

# Delete a Virtual Account

Permanently deactivate a virtual account. This operation disables the account from receiving any future payments, but all its historical records and transaction data are preserved for compliance and reconciliation.

**Important:** This action is irreversible. A deleted account cannot be reactivated. If you need to resume payment collection for the same beneficiary, you must create a new virtual account.


## OpenAPI

````yaml openapi/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: Delete a Virtual Account
      operationId: delete-virtual-account
      parameters:
        - name: Authorization
          in: header
          description: >-
            Bearer access token for authentication. This token is obtained from
            the [Get Access Token](/reference/get-token) or [Refresh Access
            Token](/reference/refresh-token) endpoints.
          required: true
          schema:
            type: string
        - name: externalId
          in: path
          description: >-
            The unique identifier of the virtual account you want to manage.
            This must be the exact externalId value you provided when creating
            the account. Use this identifier to specify the target account for
            operations such as retrieving its status or deleting it.
          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: '[Currency codes](/reference/currency-codes).'
                  externalId:
                    type: string
                    description: >-
                      The unique identifier for the virtual account. This is the
                      same externalId supplied in your request, confirming the
                      deactivation operation was performed on the correct
                      account.
                  internalId:
                    type: string
                    description: Localpayment transaction identifier.
                  accountNumber:
                    type: string
                    description: Localpayment account number.
                  beneficiary:
                    type: object
                    title: beneficiary
                    description: "The individual or entity that will receive the funds paid into this virtual account. The beneficiary is the final recipient of the money and is not necessarily the legal owner or holder of the virtual account itself.\r\n"
                    properties:
                      type:
                        type: string
                        enum:
                          - COMPANY
                          - INDIVIDUAL
                        description: Beneficiary type.
                      name:
                        type: string
                        description: Beneficiary name.
                      document:
                        type: object
                        description: Beneficiary documentation.
                        properties:
                          type:
                            type: string
                            description: >-
                              The type of [identity document
                              types](/reference/identity-document-types), such
                              as a National Identity Number, Social Security
                              Number, or Driver's License, depending on the
                              country of issuance.
                            examples:
                              - RUC
                          id:
                            type: string
                            description: >-
                              Identity document number (usually a number). This
                              must be a valid number according to the rules for
                              the specific document type.
                            examples:
                              - '1791234561009'
                        examples:
                          - type: RUC
                            id: '1791234561009'
                      lastName:
                        type: string
                        description: Beneficiary's last name.
                      fullName:
                        type: string
                        description: Beneficiary's full name.
                      bank:
                        type: object
                        properties:
                          branch:
                            type: object
                            description: Bank branch details.
                            properties:
                              code:
                                type: string
                                description: Branch code.
                          account:
                            type: object
                            description: Beneficiary's bank account details.
                            properties:
                              number:
                                type: string
                                description: Account number.
                              aliases:
                                type: array
                                description: >-
                                  Array of account aliases (e.g., unique
                                  identifiers for the account).
                                items:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      description: >-
                                        The type of alias (e.g.,
                                        `RandomKeyCode`).
                                    value:
                                      type: string
                                      description: Alias value.
                              owner:
                                type: object
                                description: Account owner's document details.
                                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: >-
                      Array of errors that occurred during the transaction. If
                      the transaction was successful, this array will be empty.
                    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: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Status code.
                      detail:
                        type: string
                        description: Additional response details.
                    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: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Additional information of the response.
                  code:
                    type: string
                    description: Status code.
                  messages:
                    type: array
                    description: Message list.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token class.
                        token_type:
                          type: string
                          description: Token type.
                        message:
                          type: string
                          description: Message with additional information.
                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: status
      description: Operation status.
      properties:
        code:
          type: string
          description: Status code.
        description:
          type: string
          description: Status description.
        detail:
          type: string
          description: Additional status information.
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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