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

# Update virtual account

> Update an existing virtual account



## OpenAPI

````yaml patch /virtual-account/{virtualAccountId}
openapi: 3.1.0
info:
  title: Slash Public API
  description: API description
  version: 0.0.1
  contact: {}
servers:
  - url: https://api.slash.com
    description: production
security:
  - api_key: []
  - partner_api_key: []
  - bearer: []
  - developer_application: []
paths:
  /virtual-account/{virtualAccountId}:
    parameters:
      - name: virtualAccountId
        in: path
        schema:
          type: string
        required: true
    patch:
      tags: []
      description: Update an existing virtual account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - update
                      description: >-
                        The type of action to take. An action of type "update"
                        will update the virtual account with the specified
                        properties.
                    name:
                      type: string
                      description: The name to update the virtual account with.
                    commissionDetails:
                      $ref: '#/components/schemas/VirtualAccountCommissionDetails'
                      x-entrypoint:
                        virtualPath: schemas/VirtualAccountCommissionDetails
                        sourcePath: schemas/VirtualAccountCommissionDetails.yaml
                        title: VirtualAccountCommissionDetails
                        origin: ./src/publicApi
                  required:
                    - action
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - close
                      description: >-
                        The type of action to take. An action of type "close"
                        will close the virtual account.
                  required:
                    - action
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  virtualAccount:
                    $ref: '#/components/schemas/VirtualAccountModel'
                    x-entrypoint:
                      virtualPath: schemas/VirtualAccountModel
                      sourcePath: schemas/VirtualAccountModel.yaml
                      title: VirtualAccountModel
                      origin: ./src/publicApi
                  commissionRule:
                    $ref: '#/components/schemas/VirtualAccountCommissionRule'
                    x-entrypoint:
                      virtualPath: schemas/VirtualAccountCommissionRule
                      sourcePath: schemas/VirtualAccountCommissionRule.yaml
                      title: VirtualAccountCommissionRule
                      origin: ./src/publicApi
                required:
                  - virtualAccount
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - api_key: []
        - bearer: []
components:
  schemas:
    VirtualAccountCommissionDetails:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - flatFee
              description: >
                The type of the commission rule. A type of flat_fee will take a
                flat fee from the virtual account and transfer it to the primary
                account

                with the frequency of the collection defined as monthly or
                yearly.
            amount:
              $ref: '#/components/schemas/Money'
              description: >-
                The amount of money to be diverted from the virtual account if
                the type of rule is flat_fee.
              x-entrypoint:
                virtualPath: schemas/Money
                sourcePath: schemas/Money.yaml
                title: Money
                origin: ./src/publicApi
            frequency:
              type: string
              enum:
                - monthly
                - yearly
              description: >
                The frequency from the start date that the rule will be applied.
                E.g. a start date of November 26, 2024 with a frequency of
                "monthly"

                will have the rule applied on December 26, 2024. If the
                frequency was "yearly", the rule would be applied again on
                November 26, 2025.
            startDate:
              type: string
              format: date-time
              description: The date that the rule will begin to take effect.
          required:
            - type
            - frequency
            - amount
        - type: object
          properties:
            type:
              type: string
              enum:
                - takeRate
              description: >
                The type of the commission rule. A type of take_rate will take a
                percent of the virtual account's funds and divert them to

                the primary account.
            takeRate:
              type: number
              description: >-
                The percentage of funds to divert from the virtual account to
                the primary account.
          required:
            - type
            - takeRate
      x-entrypoint:
        virtualPath: schemas/VirtualAccountCommissionDetails
        sourcePath: schemas/VirtualAccountCommissionDetails.yaml
        title: VirtualAccountCommissionDetails
        origin: ./src/publicApi
      title: VirtualAccountCommissionDetails
    VirtualAccountModel:
      type: object
      properties:
        id:
          type: string
          description: The ID of the virtual account.
        name:
          type: string
          description: The name of the virtual account.
        accountNumber:
          type: string
          description: The account number of the virtual account.
        routingNumber:
          type: string
          description: The routing number of the virtual account.
        accountId:
          type: string
          description: >-
            The account ID of the Slash account the virtual account is
            associated with.
        closedAt:
          type: string
          description: >-
            The date the virtual account was closed; will be null if account was
            never closed.
        accountType:
          type: string
          enum:
            - default
            - primary
          description: >
            The account type of the virtual account. Since virtual accounts and
            Slash accounts exist at the same hierarchy level,

            an account type of 'primary' means it is the main Slash account,
            while an account type of 'default' means it is a virtual account

            under the main account.
      description: The virtual account object
      required:
        - id
        - name
        - accountId
        - accountType
      x-entrypoint:
        virtualPath: schemas/VirtualAccountModel
        sourcePath: schemas/VirtualAccountModel.yaml
        title: VirtualAccountModel
        origin: ./src/publicApi
      title: VirtualAccountModel
    VirtualAccountCommissionRule:
      type: object
      properties:
        id:
          type: string
          description: The ID of the commission rule
        virtualAccountId:
          type: string
          description: The ID of the virtual account the commission rule is applied to
        commissionDetails:
          $ref: '#/components/schemas/VirtualAccountCommissionDetails'
          description: Describes details of the commission rule.
          x-entrypoint:
            virtualPath: schemas/VirtualAccountCommissionDetails
            sourcePath: schemas/VirtualAccountCommissionDetails.yaml
            title: VirtualAccountCommissionDetails
            origin: ./src/publicApi
      description: The virtual account commission rule object
      required:
        - id
        - virtualAccountId
        - commissionDetails
      x-entrypoint:
        virtualPath: schemas/VirtualAccountCommissionRule
        sourcePath: schemas/VirtualAccountCommissionRule.yaml
        title: VirtualAccountCommissionRule
        origin: ./src/publicApi
      title: VirtualAccountCommissionRule
    Error:
      type: object
      properties:
        message:
          type: string
        name:
          type: string
        identifier:
          type: string
        rawStatus:
          type: number
        meta:
          type: object
          additionalProperties: true
      required:
        - message
        - name
        - identifier
        - rawStatus
      x-entrypoint:
        origin: ./src/publicApi
        sourcePath: ./src/publicApi/main.yaml
        title: Error
        virtualPath: components/Error
      title: Error
    Money:
      type: object
      description: Represents a monetary value
      properties:
        amountCents:
          type: integer
          description: The amount in cents
      required:
        - amountCents
      x-entrypoint:
        virtualPath: schemas/Money
        sourcePath: schemas/Money.yaml
        title: Money
        origin: ./src/publicApi
      title: Money
  securitySchemes:
    api_key:
      type: apiKey
      description: |
        API key authentication for public API requests.

        Keys come in two flavors:

        - *Legal-entity-scoped keys* are pinned to a single legal entity.
          Minted via the dashboard under a specific entity; every request
          acts on that entity.
        - *User-scoped keys* are pinned to a user and span every legal
          entity that user has access to. Every request made with a
          user-scoped key (except `GET /legal-entity`, which lists the
          legal entities the user can access) must include an
          `x-legal-entity` header naming the legal entity the request is
          operating on. Requests without the header are rejected with
          `400`. The authenticated user must have an active permission
          role on the supplied legal entity, otherwise the request is
          rejected with `403`.
      name: X-API-Key
      in: header
    partner_api_key:
      type: apiKey
      description: |
        Partner-program API key authentication.

        Keys are minted in the partner dashboard (Developers → API Keys),
        are scoped to a single partner program, and are prefixed with
        `sk_partner_`. Partner keys are only accepted by routes that
        declare this scheme; they are rejected by `api_key` routes and
        vice versa.
      name: X-API-Key
      in: header
    bearer:
      type: http
      scheme: bearer
    developer_application:
      type: http
      scheme: basic

````