# 虚拟账户销户

> 为指定用户提交虚拟账户销户申请。

```yaml
openapi: 3.1.0
x-onerway-docs-version: original
x-onerway-spec-key: embedded-finance/virtual-accounts/close-virtual-account
info:
  title: 虚拟账户销户
  version: original
  description: 为指定用户提交虚拟账户销户申请。
servers:
  - url: https://sandbox-baas.onerway.com/embedded-finance
    description: sandbox
  - url: https://baas.onerway.com
    description: production
paths:
  /api/v2/virtual-account/close:
    post:
      summary: 虚拟账户销户
      description: 为指定用户提交虚拟账户销户申请。
      parameters:
        - name: apiKey
          in: header
          required: true
          description: 用于访问嵌入式金融 API 的 API key。
          schema:
            type: string
            description: 用于访问嵌入式金融 API 的 API key。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: integer
                  description: 待销户虚拟账户所属用户的 ID。
                vaApplicationId:
                  type: integer
                  description: 开户请求返回的虚拟账户申请 ID。
                vaCloseReason:
                  type: string
                  description: 申请虚拟账户销户的原因。
                  x-onerway-constraints:
                    - kind: range
                      max: 512
                      unit: 字符
              required:
                - userId
                - vaApplicationId
                - vaCloseReason
            examples:
              default:
                summary: 申请虚拟账户销户
                value:
                  userId: 12345678
                  vaApplicationId: 987654321
                  vaCloseReason: VA Cancellation Reason
      responses:
        "200":
          description: 销户申请成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Onerway 返回的响应码；`20000` 表示申请销户成功。
                  respMsg:
                    type: string
                    description: 响应码对应的可读消息。
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      {}
                    description: 响应数据；成功示例中为 `null`。
                    x-onerway-value:
                      nullable: true
              examples:
                success:
                  summary: 销户申请成功
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data: null
      security:
        - apiKeyAuth:
            []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
```
