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

# Close a virtual bank account

> Decommission a virtual bank account so its bank details stop accepting money.

**Requires scope:** `manage:accounts` — see [Required scopes](/getting-started/authentication#required-scopes-finance-api).

Moves an `ACTIVE` virtual bank account to `CLOSED` and asks the payment provider to decommission the bank details. The local transition is applied first, so a provider outage never blocks a closure.

<Warning>Read `providerClosureStatus` on the response. Only `SUCCEEDED` means the bank details are dead. `FAILED` means they are presumed live — call this endpoint again; it is idempotent and retries only the provider leg.</Warning>

Closing frees the account's `(currency, targetCryptocurrency)` slot immediately, so a replacement can be created straight away. Money that still arrives on closed details is recorded and can be settled by Venly afterwards; it is never lost. `CLOSED` accounts stay visible in list and detail reads. See [Closing a virtual bank account](/guides/finance/virtual-bank-accounts#closing-a-virtual-bank-account).


## OpenAPI

````yaml api-reference/Finance-API-Specs.yaml POST /accounts/{accountId}/virtual-bank-accounts/{virtualBankAccountId}/close
openapi: 3.1.0
info:
  title: Venly Finance API
  description: >
    REST API for the Venly Finance platform:

    - Party management (Individuals & Organisations)

    - Identity verification — hosted KYC/KYB links and Sumsub share-token
    forwarding

    - Account management with party association

    - Wallet balances & token allowances on supported chains

    - Virtual bank accounts for global pay-in (EUR SEPA, USD ACH/WIRE/RTP/SWIFT)

    - Fiat-to-crypto payment sessions (pay-in)

    - Bank pay-outs — beneficiary allow-listing, routes, and PULL/PUSH pay-outs

    - Account-to-account fiat & crypto transfers

    - EIP-2612 permits and allowances

    - Webhook registration for asynchronous event delivery


    ## Authentication


    All endpoints use OAuth2 client credentials. Obtain a token first, then
    include it in every request:


    **Step 1 — Get a token:**

    ```bash

    curl -X POST
    https://login.venly.io/auth/realms/VenlyFinance/protocol/openid-connect/token
    \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d "grant_type=client_credentials&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}"
    ```


    **Step 2 — Use the token:**

    ```

    Authorization: Bearer {access_token}

    ```


    Tokens expire after **5 minutes**. Implement refresh logic in your client.


    ## Selecting a tenant


    A token that grants more than one tenant must say which one each request is
    for, in the

    `x-tenant-id` header. With a single-tenant token, omit it. Any value you
    send must exactly match a

    tenant the token grants; a missing, malformed or foreign value is answered
    with a generic

    `403 forbidden` that reveals nothing about which tenants exist. Send the
    header at most once.


    ## Request correlation


    Every response — including `401` and `403` — carries an `X-Correlation-Id`
    header identifying the

    operation in our logs. Quote it in a support request. You may supply your
    own, as

    `X-Correlation-Id` or (as a fallback) `X-Request-Id`, matching
    `^[A-Za-z0-9_.:-]{1,64}$`. A value

    outside that shape is replaced with a generated one rather than rejected.
  version: 1.10.0
  contact:
    name: Venly Support
    email: support@venly.io
    url: https://docs.venlyfinance.com
  license:
    name: Proprietary
  x-logo:
    url: https://venlyfinance.com/logo.png
  x-security-contact: security@venly.io
servers:
  - url: https://api.venlyfinance.com/v1
    description: Production
  - url: https://api-staging.venlyfinance.com/v1
    description: Staging
security:
  - OAuth2: []
tags:
  - name: Parties
    description: Party management (Individuals & Organisations)
  - name: Accounts
    description: Account management, party-role associations
  - name: Wallets
    description: Blockchain wallet balances
  - name: Virtual Bank Accounts
    description: Virtual bank account payment references for global payments
  - name: Fiat-to-crypto Payment Sessions
    description: >-
      Hosted fiat-to-crypto pay-in sessions. **Coming soon** — not yet enabled;
      use a virtual bank account to receive fiat today.
  - name: Payout Bank Accounts
    description: Allow-listing beneficiary bank accounts as pay-out destinations
  - name: Payout Routes
    description: >-
      Account-scoped routes pairing a beneficiary bank account with a crypto
      deposit asset
  - name: Payouts
    description: Crypto-to-fiat pay-outs over a registered route
  - name: Transfers
    description: Fiat and crypto transfer operations between accounts
  - name: Permits
    description: EIP-712 permit signature management for token approvals
  - name: Supported Assets
    description: >-
      Discover which chains and assets your tenant can settle in, and whether an
      account can use them yet.
  - name: Allowances
    description: Token allowance management for wallets
  - name: Webhooks
    description: Webhook registration, delivery testing and delivery history
  - name: Pay-Ins
    description: >-
      The pay-in ledger — every fiat credit that settled (or failed to settle)
      into an account wallet
  - name: Billing
    description: The invoices Venly has issued to your company
  - name: API Credentials
    description: Self-service management of your company's OAuth client credentials
  - name: Company
    description: Your own company profile
paths:
  /accounts/{accountId}/virtual-bank-accounts/{virtualBankAccountId}/close:
    parameters:
      - $ref: '#/components/parameters/TenantId'
    post:
      tags:
        - Virtual Bank Accounts
      summary: Close a virtual bank account
      description: >
        **Requires scope:** `manage:accounts`


        Transitions an `ACTIVE` virtual bank account to `CLOSED` and
        decommissions the bank details at

        the payment provider so they stop accepting money.


        The local transition is authoritative and is applied **before** the
        provider is contacted, so a

        provider outage never blocks a closure. **Read `providerClosureStatus`
        on the response to know

        whether the bank details are actually dead:** `SUCCEEDED` means the
        provider closed them;

        `NOT_SUPPORTED` means that provider offers no closure and the details
        stay live indefinitely;

        `FAILED` means the call failed and they are presumed live. Calling this
        endpoint again is safe

        and retries only the provider leg, so a transient `FAILED` clears
        itself; one that persists needs

        support.


        Closing frees the account's `(currency, targetCryptocurrency)` slot
        immediately, so a replacement

        can be created straight away — including while a `FAILED` predecessor's
        bank details are still

        reachable. Money that arrives on closed details — after a `FAILED`
        closure, or in the window

        before an in-flight transfer completes — is never lost: it is recorded
        and can be settled

        afterwards by Venly.


        Idempotent: closing an already-`CLOSED` account returns `200` with the
        unchanged representation.

        `CLOSED` accounts remain visible in list and detail reads.
      operationId: closeVirtualBankAccount
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - $ref: '#/components/parameters/VirtualBankAccountId'
      responses:
        '200':
          description: >-
            Virtual bank account closed (or already closed — the call is
            idempotent)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleVirtualBankAccountResponse'
              example:
                success: true
                result:
                  id: 4d5e6f70-8192-4a3b-9c4d-5e6f7081920a
                  accountId: b2a1f0e9-8c7d-4e3a-9f21-0a1b2c3d4e5f
                  bankAccountType: EUR_SEPA
                  name: EUR Deposits
                  status: CLOSED
                  providerClosureStatus: SUCCEEDED
                  currency: EUR
                  targetCryptocurrency: USDC
                  iban: DE89370400440532013000
                  bic: DEUTDEDB
                  bankName: Example Bank
                  beneficiaryName: Jane Doe
                  referenceCode: VFY-7K2Q-931
                  depositRails:
                    - railType: SEPA
                      iban: DE89370400440532013000
                      bic: DEUTDEDB
                      bankName: Example Bank
                      beneficiaryName: Jane Doe
                      paymentReference: VFY-7K2Q-931
                  createdAt: '2026-01-15T09:30:00Z'
                  updatedAt: '2026-09-02T14:05:31Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >
            Virtual bank account not found — an unknown id, an id belonging to
            another account or company,

            or a `PENDING` shell that has not been exposed yet and so cannot be
            closed either.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    TenantId:
      name: x-tenant-id
      in: header
      required: false
      description: >
        Which tenant the request is scoped to, among those your token grants.
        Omit it when the token

        grants exactly one tenant; it is **required** when the token grants more
        than one. A supplied

        value must exactly match a tenant the token grants.


        Absent when required, blank, malformed, or naming a tenant the token
        does not grant — each gets

        the same generic `403 forbidden`, which reveals neither whether a tenant
        exists nor which ones

        you may use. Send the header once: a repeated header is rejected the
        same way.
      schema:
        type: string
        format: uuid
        example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
    AccountId:
      name: accountId
      in: path
      required: true
      description: Unique account identifier
      schema:
        type: string
        format: uuid
      example: b2a1f0e9-8c7d-4e3a-9f21-0a1b2c3d4e5f
    VirtualBankAccountId:
      name: virtualBankAccountId
      in: path
      required: true
      description: Unique virtual bank account identifier
      schema:
        type: string
        format: uuid
      example: 4d5e6f70-8192-4a3b-9c4d-5e6f7081920a
  schemas:
    SingleVirtualBankAccountResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            result:
              $ref: '#/components/schemas/VirtualBankAccount'
    ErrorResponse:
      type: object
      description: Error response wrapper
      properties:
        success:
          type: boolean
          description: Always false for error responses
          example: false
        errors:
          type: array
          description: List of errors that occurred
          items:
            $ref: '#/components/schemas/ErrorBody'
        result:
          type: object
          nullable: true
          description: Null or omitted when success is false
    BaseResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates whether the request was successful
    VirtualBankAccount:
      type: object
      description: >
        Virtual bank account for receiving fiat payments that are auto-converted
        to crypto.

        `EUR_SEPA` accounts return `iban`/`bic`; `USD_ACH` accounts return

        `accountNumber`/`routingNumber`. Read `depositRails` for the complete
        instruction set

        per rail — the summary fields below always describe the primary rail.
      properties:
        id:
          type: string
          format: uuid
        accountId:
          type: string
          format: uuid
        bankAccountType:
          $ref: '#/components/schemas/BankAccountType'
        name:
          type: string
          description: Display name for the bank account
        status:
          $ref: '#/components/schemas/VirtualBankAccountStatus'
        providerClosureStatus:
          allOf:
            - $ref: '#/components/schemas/ProviderClosureStatus'
          nullable: true
          description: Present only once the account is `CLOSED`
        currency:
          $ref: '#/components/schemas/FiatCurrency'
          description: Fiat currency this account receives
        targetCryptocurrency:
          $ref: '#/components/schemas/Cryptocurrency'
          description: Cryptocurrency that incoming fiat is converted to
        iban:
          type: string
          description: IBAN for EUR_SEPA accounts
          example: DE89370400440532013000
        bic:
          type: string
          nullable: true
          description: BIC/SWIFT code (EUR rails)
          example: DEUTDEDB
        accountNumber:
          type: string
          nullable: true
          description: Account number (US rails)
          example: '8412009371'
        routingNumber:
          type: string
          nullable: true
          description: Routing number (US rails)
          example: '021000021'
        bankName:
          type: string
          nullable: true
          description: Name of the banking provider
        beneficiaryName:
          type: string
          nullable: true
          description: Name of the account beneficiary
        referenceCode:
          type: string
          nullable: true
          description: Unique reference code to include in payment transfers
        depositRails:
          type: array
          description: >
            Every payment rail this account is reachable over, each with the
            full instruction set a

            payer's bank needs. USD accounts typically expose ACH, WIRE, RTP and
            SWIFT sharing the

            same account and routing number; EUR accounts expose a single SEPA
            rail.
          items:
            $ref: '#/components/schemas/DepositRail'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorBody:
      type: object
      description: Individual error details
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: invalid-request
        message:
          type: string
          description: Human-readable error message
          example: The request contains invalid parameters.
    BankAccountType:
      type: string
      description: >
        Rail family of a virtual bank account, resolved from the requested
        currency pair.

        - `EUR_SEPA` — Euro SEPA account, returning `iban` + `bic`

        - `USD_ACH` — US account, returning `accountNumber` + `routingNumber`


        Omitted while `status` is `PENDING`, before the provider has returned
        the rail type.
      enum:
        - EUR_SEPA
        - USD_ACH
    VirtualBankAccountStatus:
      type: string
      description: >
        Status of a virtual bank account.

        - `PENDING` — claimed, but the provider has not yet returned the deposit
        rails

        - `ACTIVE` — accepting fiat deposits

        - `CLOSED` — decommissioned. Read `providerClosureStatus` to know
        whether the bank details are still reachable
      enum:
        - PENDING
        - ACTIVE
        - CLOSED
    ProviderClosureStatus:
      type: string
      description: >
        For a `CLOSED` virtual bank account, whether the bank details were also
        decommissioned at the

        payment provider. **Only `SUCCEEDED` means the bank details are dead.**

        - `SUCCEEDED` — the provider confirmed closure; the details can no
        longer receive money

        - `NOT_SUPPORTED` — the provider offers no closure, so the details
        remain live. Money sent to them still arrives and is recorded for
        recovery. Not returned by any current provider

        - `FAILED` — the closure call failed; the details are presumed live.
        Call close again — it is idempotent and retries only the provider leg. A
        failure that persists needs Venly support
      enum:
        - SUCCEEDED
        - NOT_SUPPORTED
        - FAILED
    FiatCurrency:
      type: string
      description: >-
        Supported fiat currencies. Virtual bank accounts currently support EUR
        only.
      enum:
        - EUR
        - GBP
        - USD
    Cryptocurrency:
      type: string
      description: Supported cryptocurrency / stablecoin asset
      enum:
        - USDC
        - EURC
        - USDT
        - USDS
    DepositRail:
      type: object
      description: One rail's complete deposit instructions for a virtual bank account.
      required:
        - railType
      properties:
        railType:
          $ref: '#/components/schemas/DepositRailType'
        iban:
          type: string
          nullable: true
          description: International Bank Account Number (SEPA)
        bic:
          type: string
          nullable: true
          description: Bank Identifier Code (SEPA and SWIFT)
        accountNumber:
          type: string
          nullable: true
          description: Account number (US rails)
        routingNumber:
          type: string
          nullable: true
          description: Routing number (US rails; absent on SWIFT, which uses the BIC)
        bankName:
          type: string
          nullable: true
        bankAddress:
          type: string
          nullable: true
          description: The bank's postal address, required by wire and SWIFT senders
        beneficiaryName:
          type: string
          nullable: true
        beneficiaryAddress:
          type: string
          nullable: true
          description: The beneficiary's postal address, required by wire and SWIFT senders
        paymentReference:
          type: string
          nullable: true
          description: >-
            Reference the payer should attach to the transfer, when the rail
            requires one
    DepositRailType:
      type: string
      description: >
        A single payment rail a virtual bank account is reachable over. USD
        accounts typically expose

        `ACH`, `WIRE`, `RTP` and `SWIFT` sharing the same account and routing
        number (`SWIFT` carries a

        BIC instead of a routing number); EUR accounts expose a single `SEPA`
        rail.
      enum:
        - ACH
        - WIRE
        - RTP
        - SWIFT
        - SEPA
  responses:
    Unauthorized:
      description: Authentication required or failed (401)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            errors:
              - code: unauthenticated
                message: Please authenticate to perform this action.
    Forbidden:
      description: Caller lacks the required authority/role (403)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            errors:
              - code: forbidden
                message: You do not have permission to access this resource.
    InternalServerError:
      description: Unexpected server error (500)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            errors:
              - code: internal-error
                message: An unexpected error occurred. Please try again later.
  securitySchemes:
    OAuth2:
      type: oauth2
      description: >
        OAuth2 client credentials flow. Token endpoints:

        - Staging:
        https://login-staging.venly.io/auth/realms/VenlyFinance/protocol/openid-connect/token

        - Production:
        https://login.venly.io/auth/realms/VenlyFinance/protocol/openid-connect/token
      flows:
        clientCredentials:
          tokenUrl: >-
            https://login-staging.venly.io/auth/realms/VenlyFinance/protocol/openid-connect/token
          scopes: {}

````

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