> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kemycard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Close a Virtual Account

> Closes the account: it no longer accepts deposits, and its status becomes `closed`. The
`virtual_account.closed` webhook is sent.

- If the account is still being opened and its bank details have not been issued yet, the creation fee is
  refunded to your `others` ops balance (`creation_fee_refunded` in the webhook).
- An account that is already `failed` or `closed` returns `422 VALIDATION_ERROR`.
- If the account cannot be closed at the moment, the request returns `422 VALIDATION_ERROR`: try again later.




## OpenAPI

````yaml POST /virtual-accounts/{code}/close
openapi: 3.1.0
info:
  title: KemyCard API
  version: '1.0'
  description: >
    KemyCard API allows you to issue virtual and physical cards, manage KYC/POA
    verification,

    create crypto wallets, virtual bank accounts, purchase gift cards and send
    payouts to bank accounts (SEPA Instant

    in EUR, ACH in USD to the United States).


    Access depends on your plan (see [Plans and
    Pricing](/getting-started/plans)). The free Découverte plan gives

    access to virtual cards with the KYC and POA endpoints and to payouts (SEPA
    and ACH), within monthly limits (25 cards

    created and 5,000 USD loaded on cards per calendar month, 5,000 USD of
    payouts per calendar month), 30 requests

    per minute per API key, 2 allowed IP addresses and 1 active webhook
    endpoint. Starter, Business and Premium give access to every product with no
    monthly limit,

    100 requests per minute per API key, 10 allowed IP addresses and 10 active
    webhook endpoints.


    Plan errors: `402 PLAN_UPGRADE_REQUIRED` (product not included in your
    plan), `403 PLAN_LIMIT_REACHED`

    (limit of your plan reached). While one of your ops balances is negative,
    every request other than `GET`

    returns `403 ACCOUNT_SUSPENDED_NEGATIVE_BALANCE`.
  contact:
    name: KemyCard API Support
    email: hi@kemycard.com
servers:
  - url: https://api.kemycard.com/v1
    description: Development (tests internes)
  - url: https://api.kemycard.com/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Customers
    description: Manage your customers
  - name: Card Products
    description: Browse the card product catalog
  - name: Cards
    description: Issue and manage cards
  - name: KYC
    description: Identity verification
  - name: POA
    description: Proof of address verification
  - name: Wallets
    description: Crypto wallets
  - name: Virtual Accounts
    description: >
      Virtual bank accounts in EUR, USD, BRL and MXN for your individual
      customers. Deposits are converted to USDC

      and sent, net of the KemyCard fee, to a USDC wallet on Solana of the
      customer or to an external Solana address
  - name: Gift Cards
    description: Gift card catalog and purchases
  - name: Payouts
    description: >
      Payouts to bank accounts: SEPA Instant in EUR (paid from your Payout SEPA
      balance) and ACH in USD to bank

      accounts in the United States (paid from your Ops Others balance)
  - name: Balance
    description: Operational balances and transaction history
  - name: Webhooks
    description: Webhook endpoints and delivery management
paths:
  /virtual-accounts/{code}/close:
    post:
      tags:
        - Virtual Accounts
      summary: Close a virtual account
      description: >
        Closes the account: it no longer accepts deposits, and its status
        becomes `closed`. The

        `virtual_account.closed` webhook is sent.


        - If the account is still being opened and its bank details have not
        been issued yet, the creation fee is
          refunded to your `others` ops balance (`creation_fee_refunded` in the webhook).
        - An account that is already `failed` or `closed` returns `422
        VALIDATION_ERROR`.

        - If the account cannot be closed at the moment, the request returns
        `422 VALIDATION_ERROR`: try again later.
      operationId: closeVirtualAccount
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Code of the virtual account
      responses:
        '200':
          description: Virtual account closed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountSuccessResponse'
        '402':
          $ref: '#/components/responses/PlanUpgradeRequired'
        '403':
          $ref: '#/components/responses/AccountSuspended'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    VirtualAccountSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/VirtualAccount'
        meta:
          $ref: '#/components/schemas/Meta'
    VirtualAccount:
      type: object
      properties:
        code:
          type: string
          format: uuid
          description: Virtual account code
        customer_code:
          type: string
          format: uuid
        external_reference:
          type: string
          description: Your reference of the customer
          example: user-001
        currency:
          type: string
          enum:
            - EUR
            - USD
            - BRL
            - MXN
          example: EUR
        status:
          type: string
          enum:
            - processing
            - awaiting_tos
            - awaiting_provider
            - active
            - failed
            - closed
          example: active
        destination:
          $ref: '#/components/schemas/VirtualAccountDestination'
        deposit_instructions:
          type: object
          nullable: true
          description: >
            Bank details to share with the payer, once they have been issued
            (`null` before). The fields depend on

            the currency: `iban` and `bic` for EUR (SEPA), `bank_routing_number`
            and `bank_account_number` for USD

            (ACH, FedNow, wire), `br_code` for BRL (PIX), `clabe` for MXN
            (SPEI). Every format includes `currency`

            and `payment_rails`.
          additionalProperties: true
          example:
            currency: eur
            payment_rails:
              - sepa
            iban: LU00TEST0000000000000000
            bic: TESTLULL
            account_holder_name: Alice Martin
            bank_name: Test Bank S.A.
            bank_address: 1 Test Street, L-0000 Luxembourg
        tos_url:
          type: string
          nullable: true
          description: >
            Only with the status `awaiting_tos`: the page where your customer
            accepts the terms of our banking

            partner. Your customer must accept them themselves.
        creation_fee:
          type: number
          description: Creation fee debited from your `others` ops balance
          example: 10
        failure_reason:
          type: string
          nullable: true
          description: Only with the status `failed`
          example: The customer was not approved by our banking partner.
        created_at:
          type: string
          format: date-time
        activated_at:
          type: string
          format: date-time
          nullable: true
        closed_at:
          type: string
          format: date-time
          nullable: true
    Meta:
      type: object
      properties:
        request_id:
          type: string
          example: a4f8e2c1b3d97056
        mode:
          type: string
          enum:
            - test
            - live
          example: test
        timestamp:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              description: >
                Error code, for example `AUTHENTICATION_REQUIRED`,
                `AUTHENTICATION_FAILED`, `ACCOUNT_RESTRICTED`,

                `IP_NOT_ALLOWED`, `PLAN_UPGRADE_REQUIRED`, `PLAN_LIMIT_REACHED`,
                `ACCOUNT_SUSPENDED_NEGATIVE_BALANCE`,

                `INSUFFICIENT_BALANCE`, `OPERATION_FAILED`, `FORBIDDEN`,
                `RESOURCE_NOT_FOUND`, `VALIDATION_ERROR`,

                `COUNTRY_NOT_SUPPORTED`, `RATE_LIMIT_EXCEEDED`,
                `INTERNAL_ERROR`, `wrong_api_host`. See [Error
                Handling](/guides/error-handling).
              example: VALIDATION_ERROR
            message:
              type: string
              example: Missing required fields.
            details:
              type: object
              nullable: true
        meta:
          $ref: '#/components/schemas/Meta'
    VirtualAccountDestination:
      type: object
      properties:
        type:
          type: string
          enum:
            - wallet
            - external_address
          example: wallet
        wallet_code:
          type: string
          format: uuid
          description: Only with `type` `wallet`
          example: 01a11628-4600-7e59-bd4a-01604c588373
        blockchain:
          type: string
          enum:
            - solana
          example: solana
        currency:
          type: string
          enum:
            - USDC
          example: USDC
        address:
          type: string
          description: >-
            Address of the wallet (`wallet`) or the external address
            (`external_address`)
          example: CUSTOMER_DEPOSIT_ADDRESS
  responses:
    PlanUpgradeRequired:
      description: The product is not included in your plan
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: PLAN_UPGRADE_REQUIRED
              message: >-
                This product is not included in the Découverte plan. Upgrade to
                a paid plan (Starter, Business or Premium) to use "wallets".
              details:
                plan: decouverte
                product: wallets
    AccountSuspended:
      description: >-
        One of your ops balances is negative; every request other than `GET` is
        refused until it is topped up
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: ACCOUNT_SUSPENDED_NEGATIVE_BALANCE
              message: >-
                Your account is suspended because one of your ops balances is
                negative. Top up the negative balance to restore access.
                Read-only requests (GET) remain available.
              details:
                negative_balance_since: '2026-10-15T08:00:00+00:00'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: RESOURCE_NOT_FOUND
              message: Resource not found.
              details: null
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk_test_... or sk_live_...)

````

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