> ## 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 PUT /api/virtual-account/{externalId}/activation/{status}/
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}/activation/{status}/:
    put:
      summary: 启用或禁用虚拟帐户
      operationId: update-virtual-account-status
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。
          required: true
          schema:
            type: string
        - name: status
          in: path
          description: '`enable` 或 `disable`。'
          required: true
          schema:
            type: string
            enum:
              - enable
              - disable
            examples:
              - enable
        - name: externalId
          in: path
          description: >-
            您要管理的虚拟账户的唯一标识符。此标识符必须与您创建账户时提供的 externalId
            值完全一致。使用此标识符可以指定目标账户，以便执行诸如启用或停用该账户等操作。
          required: true
          schema:
            type: string
            pattern: '[a-zA-Z0-9\- ]+'
            examples:
              - 53025bf4-4c87-4b4f-8fea-b47004440f37
      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:
                    type: object
                    title: 状态
                    description: 操作状态。
                    properties:
                      code:
                        type: string
                        description: '[状态码](/zh/reference/validate-identity-document)。'
                      description:
                        type: string
                        description: '[状态描述](/zh/reference/validate-identity-document)。'
                      detail:
                        type: string
                        description: 更多状态信息。
                  errors:
                    type: array
                    description: 交易过程中发生的错误数组。如果交易成功，则此数组为空。
                    items:
                      type: object
                x-examples:
                  Example 1:
                    currency: MXN
                    externalId: e36ef959-12d4-4cf0-b00c-99dc51798f4b
                    internalId: c09095fb-6a0e-47ff-9143-9d9452b0f290
                    accountNumber: '{{accountNumber}}'
                    beneficiary:
                      type: INDIVIDUAL
                      name: FirtName
                      document:
                        type: RFC
                        id: EXTF900101NI1
                      bank:
                        branch: {}
                        account:
                          number: '646011319800023800'
                          aliases: []
                          owner:
                            document: {}
                      fullName: FirtName LastName
                      lastName: LastName
                    status:
                      code: '200'
                      description: COMPLETED
                      detail: Virtual account has been created
                    errors: []
              examples:
                200 - Virtual account has been created.:
                  value:
                    currency: MXN
                    externalId: e36ef929-c2d4-fcf0-b30c-99dc51798f4b
                    internalId: c09095fb-6a0e-47af-9f43-3d9452b0f290
                    accountNumber: '{{yourLocalpaymentAccountNumber}}'
                    beneficiary:
                      type: INDIVIDUAL
                      name: John
                      document:
                        type: RFC
                        id: EXTF900101NI1
                      bank:
                        branch: {}
                        account:
                          number: '646011319800023123'
                          aliases: []
                          owner:
                            document: {}
                      fullName: John Doe
                      lastName: Doe
                    status:
                      code: '200'
                      description: COMPLETED
                      detail: Virtual account has been created
                    errors: []
                300 - Virtual account disabled.:
                  value:
                    currency: MXN
                    externalId: e36eff59-22d4-ccf0-bf0c-99dc51798f4b
                    internalId: c09095fb-6a4e-17cf-9343-9d9452b0f290
                    accountNumber: '{{yourLocalpaymentAccountNumber}}'
                    beneficiary:
                      type: INDIVIDUAL
                      name: John
                      document:
                        type: RFC
                        id: EXTF900101NI1
                      bank:
                        branch: {}
                        account:
                          number: '646011319800023123'
                          aliases: []
                          owner:
                            document: {}
                      fullName: John Doe
                      lastName: Doe
                    status:
                      code: '300'
                      description: DISABLED
                      detail: Virtual account disabled
                    errors: []
        '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-06T23:55:22.121+00:00'
                    status: 400
                    error: Bad Request.
                    message: >-
                      Status activation not recognize. Please use 'disable' or
                      'enable'
                    path: >-
                      /virtual-account/e36ef959-12d4-4cf0-b00c-99dc51798f4b/activation/:status
              examples:
                400 - Status activation not recognize.:
                  value:
                    timestamp: '2025-01-06T23:55:22.121+00:00'
                    status: 400
                    error: Bad Request.
                    message: >-
                      Status activation not recognize. Please use 'disable' or
                      'enable'
                    path: >-
                      /virtual-account/e36ef159-b2d4-4af0-b02c-99dc51798f4b/activation/:status
                400 - Virtual Account doesn't exist.:
                  value:
                    timestamp: '2025-01-07T00:03:14.639+00:00'
                    status: 400
                    error: Bad Request.
                    message: Virtual Account doesn't exist
                    path: >-
                      /virtual-account/e36ef959-12d4-4cf0-b00c-99dc51798f4b2/activation/disable
        '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.