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

# Create Bank Account

> Create a new bank account.

**The Bank Accounts Data Model** streamlines access of bank account information across various accounting platforms, providing a consistent and unified representation of bank account data.

## Additional Required Fields

To successfully create a bank account, certain fields must be included in the raw\_data object of the request body. The required fields are as follows:

| Integration                 | Field               | Description                                    |
| --------------------------- | ------------------- | ---------------------------------------------- |
| MYOB\_BUSINESS              | nominal\_code       | The nominal code of the bank account.          |
| MYOB\_BUSINESS              | description         | The description of the bank account.           |
| MYOB\_BUSINESS              | parent\_account\_id | The parent account ID of the bank account.     |
| MYOB\_BUSINESS              | tax\_id             | The tax ID of the bank account.                |
| SAGE\_ZA\_CLOUD\_ACCOUNTING | sub\_category\_id   | The sub-category ID associated to the account. |


## OpenAPI

````yaml POST /accounting/bank_accounts
openapi: 3.0.1
info:
  title: rootfi
  version: v3
servers:
  - url: https://api.rootfi.dev/v3
    description: global
  - url: https://api.sa.rootfi.dev/v3
    description: saudi
security: []
paths:
  /accounting/bank_accounts:
    post:
      tags:
        - AccountingBankAccounts
      summary: Create Bank Account
      description: Create a new bank account.
      operationId: accounting_bankAccounts_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/accountingCreateBankAccountRequest'
            examples:
              Example1:
                value:
                  company_id: 123
                  data:
                    - institution_name: Example Bank
                      account_name: Savings Account
                      account_number: '1234567890'
                      balance: 1000
                      currency_id: USD
                      updated_at: '2024-01-25T10:30:00Z'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accountingCreateBankAccountResponse'
              examples:
                Example1:
                  value:
                    data:
                      rootfi_id: 123
                      rootfi_deleted_at: null
                      rootfi_created_at: '2024-01-25T09:00:00Z'
                      rootfi_updated_at: '2024-01-25T09:30:00Z'
                      rootfi_company_id: 456
                      platform_id: '123456_1'
                      platform_unique_id: '123456'
                      institution_name: Example Bank
                      account_name: Savings Account
                      account_number: '1234567890'
                      balance: 1000
                      currency_id: USD
                      updated_at: '2024-01-25T10:30:00Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    accountingCreateBankAccountRequest:
      title: accountingCreateBankAccountRequest
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/accountingBankAccountFields'
          description: The data of the bank account to create
      required:
        - data
      allOf:
        - $ref: '#/components/schemas/CompanyIDRequestField'
    accountingCreateBankAccountResponse:
      title: accountingCreateBankAccountResponse
      type: object
      properties:
        data:
          $ref: '#/components/schemas/accountingBankAccountObject'
          nullable: true
          description: The data of the created bank account
        sync_id:
          type: string
          nullable: true
          description: The sync id of the request
    RootFiAPIResponseType:
      title: RootFiAPIResponseType
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RootFiAPIResponseErrorType'
          description: The error message
      required:
        - error
    accountingBankAccountFields:
      title: accountingBankAccountFields
      type: object
      properties:
        institution_name:
          type: string
          nullable: true
          description: The name of the bank account
        account_name:
          type: string
          nullable: true
          description: Name of the bank account
        account_number:
          type: string
          nullable: true
          description: The bank account number
        balance:
          type: number
          format: double
          nullable: true
          description: Balance of the bank account
        currency_id:
          type: string
          nullable: true
          description: The currency id of the bank account
        category:
          type: string
          nullable: true
          description: The category of the bank account
        updated_at:
          type: string
          nullable: true
          description: The last ISO 8601 timestamp that the data was updated at
    CompanyIDRequestField:
      title: CompanyIDRequestField
      type: object
      properties:
        company_id:
          type: integer
          description: The ID of the company in the accounting platform
        run_async:
          type: boolean
          nullable: true
          description: Run the request asynchronously
      required:
        - company_id
    accountingBankAccountObject:
      title: accountingBankAccountObject
      type: object
      properties:
        currency:
          $ref: '#/components/schemas/accountingCurrencyObject'
          nullable: true
          description: The currency of the bank account.
      allOf:
        - $ref: '#/components/schemas/AccountingRootFiBaseFields'
        - $ref: '#/components/schemas/accountingBankAccountFields'
    RootFiAPIResponseErrorType:
      title: RootFiAPIResponseErrorType
      type: object
      properties:
        message:
          type: string
          description: The error message
        code:
          type: string
          description: The error code
        field:
          type: string
          description: The status of the error
      required:
        - message
        - code
        - field
    accountingCurrencyObject:
      title: accountingCurrencyObject
      type: object
      properties: {}
      allOf:
        - $ref: '#/components/schemas/AccountingRootFiBaseFields'
        - $ref: '#/components/schemas/accountingCurrencyFields'
    AccountingRootFiBaseFields:
      title: AccountingRootFiBaseFields
      type: object
      properties:
        rootfi_id:
          type: number
          format: double
          description: The unique ID we assign for that data's information
          example: 157
        rootfi_deleted_at:
          type: string
          format: date-time
          nullable: true
          description: The date at which the data was deleted in the accounting platform
        rootfi_created_at:
          type: string
          format: date-time
          description: The date at which RootFi first synced this data
          example: '2024-01-22T05:07:31.465Z'
        rootfi_updated_at:
          type: string
          format: date-time
          description: The latest date at which RootFi updated this data
          example: '2024-01-22T05:07:31.000Z'
        rootfi_company_id:
          type: number
          format: double
          description: The ID of the company in the accounting platform
          example: 1089
        platform_id:
          type: string
          description: An unique custom RootFi ID made from platform's unique_id.
          example: '123456'
        platform_unique_id:
          type: string
          nullable: true
          description: The ID of the data in the accounting platform.
        raw_data:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            A JSON containing fields that you can directly get from the
            accounting platform.
        data_hash:
          type: string
          nullable: true
          description: The hash of the data
      required:
        - rootfi_id
        - rootfi_created_at
        - rootfi_updated_at
        - rootfi_company_id
        - platform_id
    accountingCurrencyFields:
      title: accountingCurrencyFields
      type: object
      properties:
        name:
          type: string
          nullable: true
          description: The name of the currency
        code:
          type: string
          nullable: true
          description: The currency code.
        symbol:
          type: string
          nullable: true
          description: >-
            The symbol that represents the currency. Not applicable for many
            currencies.
        is_base_currency:
          type: boolean
          nullable: true
          description: Whether the currency is the base currency for the company.
        exchange_rate:
          type: number
          format: double
          nullable: true
          description: The exchange rate for the currency.
        updated_at:
          type: string
          nullable: true
          description: The last ISO 8601 timestamp that the data was updated at.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key

````