Slash Virtual Account API

The Virtual Account API from Slash — 2 operation(s) for virtual account.

OpenAPI Specification

slash-virtual-account-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Slash Public Account Virtual Account 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: []
tags:
- name: Virtual Account
paths:
  /virtual-account:
    x-reference-path: paths/virtual-account/route.yaml
    get:
      description: 'Retrieve a list of virtual accounts under an account.

        The virtual accounts are returned in an array, with each item representing a virtual account under that account.


        The primary account will also be returned as a virtual account, with an account type of ''primary'' while actual subaccounts

        under the primary account will have an account type of ''default''.

        '
      parameters:
      - name: cursor
        required: false
        in: query
        schema:
          type: string
        description: A cursor string to fetch the next page of results
        x-reference-path: schemas/Pagination/CursorParameter.yaml
      - name: filter:accountId
        description: Pass in an account ID to filter virtual accounts by account ID. This will return all virtual accounts that match the account ID passed in.
        in: query
        schema:
          type: string
        required: false
      - name: filter:includeClosedAccounts
        description: Include virtual accounts that have been closed in the query results. By default, they will not be returned.
        in: query
        schema:
          type: string
          enum:
          - true
          - false
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/VirtualAccount'
                      x-entrypoint:
                        virtualPath: schemas/VirtualAccount
                        sourcePath: schemas/VirtualAccount.yaml
                        title: VirtualAccount
                        origin: ./src/publicApi
                  metadata:
                    $ref: '#/components/schemas/Pagination.PaginationResponse'
                    x-entrypoint:
                      virtualPath: schemas/Pagination/PaginationResponse
                      sourcePath: schemas/Pagination/PaginationResponse.yaml
                      title: PaginationResponse
                      origin: ./src/publicApi
                required:
                - items
        '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: []
      tags:
      - Virtual Account
    post:
      summary: Create a virtual account
      tags:
      - Virtual Account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accountId:
                  type: string
                  description: The account ID the virtual account should be created under.
                name:
                  type: string
                  description: The name of the virtual account
                commissionDetails:
                  $ref: '#/components/schemas/VirtualAccountCommissionDetails'
                  description: Specifies how much of the virtual account's incoming funds should be diverted to the primary account
                  x-entrypoint:
                    virtualPath: schemas/VirtualAccountCommissionDetails
                    sourcePath: schemas/VirtualAccountCommissionDetails.yaml
                    title: VirtualAccountCommissionDetails
                    origin: ./src/publicApi
              required:
              - name
              - accountId
      responses:
        '201':
          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: []
  /virtual-account/{virtualAccountId}:
    parameters:
    - name: virtualAccountId
      in: path
      schema:
        type: string
      required: true
    x-reference-path: paths/virtual-account/{virtualAccountId}/route.yaml
    get:
      description: 'Retrieve a single virtual account by its ID.

        '
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccount'
                x-entrypoint:
                  virtualPath: schemas/VirtualAccount
                  sourcePath: schemas/VirtualAccount.yaml
                  title: VirtualAccount
                  origin: ./src/publicApi
        '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: []
      tags:
      - Virtual Account
    patch:
      description: Update an existing virtual account
      tags:
      - 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:
    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
    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
    Pagination.PaginationResponse:
      type: object
      description: Response sent when requesting a list of data
      properties:
        nextCursor:
          type: string
          description: The cursor to use to retrieve the next page of data. If this is not sent, there is no more data to retrieve.
        count:
          type: number
          description: The number of items in the current page of data.
      x-entrypoint:
        virtualPath: schemas/Pagination/PaginationResponse
        sourcePath: schemas/Pagination/PaginationResponse.yaml
        title: PaginationResponse
        origin: ./src/publicApi
      title: PaginationResponse
    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
    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
    VirtualAccount:
      type: object
      properties:
        virtualAccount:
          $ref: '#/components/schemas/VirtualAccountModel'
          description: The virtual account itself
          x-entrypoint:
            virtualPath: schemas/VirtualAccountModel
            sourcePath: schemas/VirtualAccountModel.yaml
            title: VirtualAccountModel
            origin: ./src/publicApi
        balance:
          $ref: '#/components/schemas/Money'
          description: The total balance of the virtual account
          x-entrypoint:
            virtualPath: schemas/Money
            sourcePath: schemas/Money.yaml
            title: Money
            origin: ./src/publicApi
        spend:
          $ref: '#/components/schemas/Money'
          description: The total spend of the virtual account
          x-entrypoint:
            virtualPath: schemas/Money
            sourcePath: schemas/Money.yaml
            title: Money
            origin: ./src/publicApi
        commissionRule:
          $ref: '#/components/schemas/VirtualAccountCommissionRule'
          description: The commission rule applied to the virtual account, if any
          x-entrypoint:
            virtualPath: schemas/VirtualAccountCommissionRule
            sourcePath: schemas/VirtualAccountCommissionRule.yaml
            title: VirtualAccountCommissionRule
            origin: ./src/publicApi
      required:
      - virtualAccount
      - balance
      - spend
      x-entrypoint:
        virtualPath: schemas/VirtualAccount
        sourcePath: schemas/VirtualAccount.yaml
        title: VirtualAccount
        origin: ./src/publicApi
      title: VirtualAccount
  securitySchemes:
    api_key:
      type: apiKey
      description: "API key authentication for public API requests.\n\nKeys come in two flavors:\n\n- *Legal-entity-scoped keys* are pinned to a single legal entity.\n  Minted via the dashboard under a specific entity; every request\n  acts on that entity.\n- *User-scoped keys* are pinned to a user and span every legal\n  entity that user has access to. Every request made with a\n  user-scoped key (except `GET /legal-entity`, which lists the\n  legal entities the user can access) must include an\n  `x-legal-entity` header naming the legal entity the request is\n  operating on. Requests without the header are rejected with\n  `400`. The authenticated user must have an active permission\n  role on the supplied legal entity, otherwise the request is\n  rejected with `403`.\n"
      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