> ## 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: v2
servers:
  - url: https://api.rootfi.dev
    description: Production
security: []
paths:
  /accounting/bank_accounts:
    post:
      tags:
        - AccountingBankAccounts
      summary: Create Bank Account
      description: Add a bank account.
      operationId: accounting_bankAccounts_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/accountingtypesCreateBankAccountsRequest'
            examples:
              Example1:
                value:
                  company_id: 1
                  data:
                    - institution_name: Bank Central Asia
                      account_name: Rootfi Test
                      category: DEPOSIT
                      account_number: '1234567890'
                      balance: 1000000
                      currency_id: IDR
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accountingtypesCreateBankAccountsResponse'
              examples:
                Example1:
                  value:
                    data:
                      status: SUCCESS
                      upload_job_id: aXI9pUDA5T7E2LS
                      data:
                        - job_id: xQm2K441VosP8W4
                          status: success
                          response:
                            platform_id: '4009750000000000099'
                            currency_id: '4009750000000000099'
                            institution_name: rootfi 63503
                            account_name: test 22300
                            category: credit_card
                            balance: 123456
                            updated_at: '2021-09-28T15:00:00.000Z'
                            raw_data:
                              nominal_code: Rootfi 01
                              name: Test Account
                              description: Test Description
                              category: LIABILITY
                              sub_category: Long Term Liabilities
                              status: null
                          error: null
                    request_timestamp: '2021-09-28T15:00:00.000Z'
                    response_timestamp: '2021-09-28T15:00:00.000Z'
                    request_id: 7a1c0e42-9f85-4d6e-bb5d-358a72913c0b
      security:
        - ApiKeyAuth: []
components:
  schemas:
    accountingtypesCreateBankAccountsRequest:
      title: accountingtypesCreateBankAccountsRequest
      type: object
      properties:
        company_id:
          type: integer
          description: The company ID
          example: 1
        data:
          type: array
          items:
            $ref: '#/components/schemas/accountingtypesBankAccountsWriteRequestFields'
          description: The data to be passed through to the integration platform
      required:
        - company_id
        - data
    accountingtypesCreateBankAccountsResponse:
      title: accountingtypesCreateBankAccountsResponse
      type: object
      properties: {}
      allOf:
        - $ref: '#/components/schemas/accountingtypesFinalCreateBankAccount'
        - $ref: '#/components/schemas/timestamp'
    accountingtypesBankAccountsWriteRequestFields:
      title: accountingtypesBankAccountsWriteRequestFields
      type: object
      properties:
        raw_data:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            A JSON containing fields that you can directly pass to the
            accounting platform.
      allOf:
        - $ref: >-
            #/components/schemas/accountingtypesBankAccountsAllResponsesCommonFields
    accountingtypesFinalCreateBankAccount:
      title: accountingtypesFinalCreateBankAccount
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/accountingtypesCreateBankAccountsResponseDataHelper
      required:
        - data
    timestamp:
      title: timestamp
      type: object
      properties:
        request_timestamp:
          type: string
          format: date-time
          description: The time at which the request was received by the server
        response_timestamp:
          type: string
          format: date-time
          description: The time at which the response was sent by the server
        request_id:
          type: string
          description: The unique ID of the request
      required:
        - request_timestamp
        - response_timestamp
        - request_id
    accountingtypesBankAccountsAllResponsesCommonFields:
      title: accountingtypesBankAccountsAllResponsesCommonFields
      type: object
      properties:
        currency_id:
          type: string
          nullable: true
          description: The ISO-4217 currency code
        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
        category:
          type: string
          nullable: true
          description: The category of the bank account
        balance:
          type: integer
          nullable: true
          description: Balance of the bank account
    accountingtypesCreateBankAccountsResponseDataHelper:
      title: accountingtypesCreateBankAccountsResponseDataHelper
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/accountingtypesBankAccountsResponseHelper'
      required:
        - data
      allOf:
        - $ref: '#/components/schemas/SuccessResponse'
    accountingtypesBankAccountsResponseHelper:
      title: accountingtypesBankAccountsResponseHelper
      type: object
      properties:
        response:
          $ref: '#/components/schemas/accountingtypesBankAccountsWriteResponseFields'
        error:
          $ref: '#/components/schemas/ErrorObject'
          nullable: true
          description: The error message if the job failed.
      required:
        - response
      allOf:
        - $ref: '#/components/schemas/JobSuccessResponse'
    SuccessResponse:
      title: SuccessResponse
      type: object
      properties:
        status:
          $ref: '#/components/schemas/Status'
          description: The status of the job.
        upload_job_id:
          type: string
          description: The ID of the job.
      required:
        - status
        - upload_job_id
    accountingtypesBankAccountsWriteResponseFields:
      title: accountingtypesBankAccountsWriteResponseFields
      type: object
      properties:
        raw_data:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            The raw JSON response we get from the accounting platform for that
            data
      allOf:
        - $ref: '#/components/schemas/accountingtypesBankAccountResponseField'
    ErrorObject:
      title: ErrorObject
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        platform_error:
          type: string
        raw_data:
          type: object
          additionalProperties: true
          nullable: true
      required:
        - code
        - message
        - platform_error
    JobSuccessResponse:
      title: JobSuccessResponse
      type: object
      properties:
        job_id:
          type: string
          description: The ID of the job.
        status:
          $ref: '#/components/schemas/JobResponseStatus'
          description: The status of the job.
      required:
        - job_id
        - status
    Status:
      title: Status
      type: string
      enum:
        - SUCCESS
        - FAILED
        - CREATED
        - RUNNING
    accountingtypesBankAccountResponseField:
      title: accountingtypesBankAccountResponseField
      type: object
      properties:
        updated_at:
          type: string
          description: >-
            The date at which the transaction was updated on the accounting
            platform
      required:
        - updated_at
      allOf:
        - $ref: '#/components/schemas/accountingtypesBankAccountsPlatformId'
        - $ref: >-
            #/components/schemas/accountingtypesBankAccountsAllResponsesCommonFields
    JobResponseStatus:
      title: JobResponseStatus
      type: string
      enum:
        - success
        - failed
    accountingtypesBankAccountsPlatformId:
      title: accountingtypesBankAccountsPlatformId
      type: object
      properties:
        platform_id:
          type: string
          description: The ID that the accounting platform uses to identify this account
      required:
        - platform_id
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key

````