openapi: 3.0.0
info:
  title: Bank Accounts
  description: In Zoho Books, you can track your transactions, have manual and automatic feeds imported for your bank and credit card accounts.
  contact: {}
  version: 1.0.0
servers:
  - url: https://www.zohoapis.com/books/v3
    description: API Endpoint
tags:
  - name: bank-accounts
    description: Bank-Accounts Module
paths:
  /bankaccounts:
    post:
      tags:
        - bank-accounts
      operationId: create_bank_account
      summary: Create a bank account
      description: Create a bank account or a credit card account for your organization.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-a-bank-account-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-a-bank-account-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.CREATE
    get:
      tags:
        - bank-accounts
      operationId: list_bank_accounts
      summary: List view of accounts
      description: List all bank and credit card accounts for your organization.
      parameters:
        - name: filter_by
          in: query
          description: 'Filter the account by their status. Allowed Values: <code>Status.All</code>, <code>Status.Active</code> and <code>Status.Inactive</code>.'
          required: false
          schema:
            type: string
          example: Status.All
        - name: sort_column
          in: query
          description: 'Sort the values based on the allowed values. Allowed Values: <code>account_name</code>,<code>account_type</code> and <code>account_code</code>.'
          required: false
          schema:
            type: string
          example: account_name
        - name: page
          in: query
          description: Page number to be fetched. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records to be fetched per page.
          required: false
          schema:
            type: integer
            default: 10
          example: 10
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-view-of-accounts-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /bankaccounts/{account_id}:
    put:
      tags:
        - bank-accounts
      operationId: update_bank_account
      summary: Update bank account
      description: Modify the account that was created.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-bank-account-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-bank-account-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.UPDATE
    get:
      tags:
        - bank-accounts
      operationId: get_bank_account
      summary: Get account details
      description: Get a detailed look of the account specified.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-account-details-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.READ
    delete:
      tags:
        - bank-accounts
      operationId: delete_bank_account
      summary: Delete an account
      description: Delete a bank account from your organization.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-an-account-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.DELETE
    parameters:
      - name: account_id
        in: path
        required: true
        description: Unique identifier of the bank account.
        schema:
          type: string
        example: '460000000050127'
      - $ref: '#/components/parameters/organization_id'
  /bankaccounts/{account_id}/inactive:
    post:
      tags:
        - bank-accounts
      operationId: mark_bank_account_inactive
      summary: Deactivate account.
      description: Make an account inactive.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deactivate-account-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.CREATE
    parameters:
      - name: account_id
        in: path
        required: true
        description: Unique identifier of the bank account.
        schema:
          type: string
        example: '460000000050127'
      - $ref: '#/components/parameters/organization_id'
  /bankaccounts/{account_id}/active:
    post:
      tags:
        - bank-accounts
      operationId: mark_bank_account_active
      summary: Activate account
      description: Make an account active.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/activate-account-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.CREATE
    parameters:
      - name: account_id
        in: path
        required: true
        description: Unique identifier of the bank account.
        schema:
          type: string
        example: '460000000050127'
      - $ref: '#/components/parameters/organization_id'
  /bankstatements:
    post:
      tags:
        - bank-accounts
      operationId: import_bank_statements
      summary: Import a Bank/Credit Card Statement
      description: Import your bank/credit card feeds into your account.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/import-a-bankcredit-card-statement-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/import-a-bankcredit-card-statement-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /bankaccounts/{account_id}/statement/lastimported:
    get:
      tags:
        - bank-accounts
      operationId: get_last_imported_bank_statement
      summary: Get last imported statement
      description: Get the details of previously imported statement for the account.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-last-imported-statement-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.READ
    parameters:
      - name: account_id
        in: path
        required: true
        description: Unique identifier of the bank account.
        schema:
          type: string
        example: '460000000050127'
      - $ref: '#/components/parameters/organization_id'
  /bankaccounts/{account_id}/statement/{statement_id}:
    delete:
      tags:
        - bank-accounts
      operationId: delete_last_imported_bank_statement
      summary: Delete last imported statement
      description: Delete the statement that was previously imported.
      parameters:
        - name: statement_id
          in: path
          required: true
          description: Unique identifier of the bank statement.
          schema:
            type: string
          example: '460000000049013'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-last-imported-statement-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.banking.DELETE
    parameters:
      - name: account_id
        in: path
        required: true
        description: Unique identifier of the bank account.
        schema:
          type: string
        example: '460000000050127'
      - $ref: '#/components/parameters/organization_id'
components:
  parameters:
    organization_id:
      name: organization_id
      description: ID of the organization
      in: query
      required: true
      schema:
        type: string
      example: '10234695'
  schemas:
    gendoc-attributes-schema:
      $ref: '#/components/schemas/bankaccount'
    filter_by:
      description: 'Filter the account by their status. Allowed Values: <code>Status.All</code>, <code>Status.Active</code> and <code>Status.Inactive</code>.'
      type: string
      example: Status.All
    sort_column:
      description: 'Sort the values based on the allowed values. Allowed Values: <code>account_name</code>,<code>account_type</code> and <code>account_code</code>.'
      type: string
      example: account_name
    page:
      type: integer
      example: 1
    per_page:
      type: integer
      example: 10
    has_more_page:
      type: boolean
      example: false
    report_name:
      type: string
      example: Bills
    applied_filter:
      type: string
      example: Status.All
    as_of_date:
      type: string
      example: '2014-08-30'
    sort_order:
      type: string
      example: D
    account_id:
      description: ID of the Bank/Credit Card account
      type: string
      example: '460000000050127'
    account_name:
      description: Name of the account
      type: string
      example: Corporate Account
    account_code:
      description: Code of the Account
      type: string
    currency_id:
      description: ID of the Currency associated with the Account
      type: string
      example: '460000000000097'
    currency_code:
      description: Code of the currency associated with the Bank Account
      type: string
      example: USD
    account_type:
      description: Type of the account
      type: string
      example: bank
    uncategorized_transactions:
      description: Number of uncategorized transactions
      type: integer
      example: 0
    total_unprinted_checks:
      description: Number of unprinted checks.
      type: integer
      example: 0
    is_active:
      description: Check if Account is Active
      type: boolean
      example: true
    balance:
      description: Balance present in the account
      type: number
      format: double
      example: 0
    bcy_balance:
      description: Balance in Base Currency
      type: number
      format: double
      example: 0
    bank_name:
      description: Name of the Bank
      type: string
      example: Xavier Bank
    currency_symbol:
      description: Symbol of the Currency associated with the Account
      type: string
      example: $
    price_precision:
      description: Precision of the Price Values
      type: integer
      example: 2
    bank_balance:
      description: Balance present in the Bank
      type: integer
      example: 0
    description:
      description: Description of the Account
      type: string
      example: Salary details.
    account_number:
      description: Number associated with the Bank Account
      type: string
      example: '80000009823'
    routing_number:
      description: Routing Number of the Account
      type: string
      example: '123456789'
    is_primary_account:
      description: Check if the Account is Primary Account in Zoho Books
      type: boolean
      example: false
    is_paypal_account:
      description: Check if the Account is Paypal Account
      type: boolean
      example: true
    paypal_type:
      description: 'The type of Payment for the Paypal Account. Allowed Values : <code>standard</code> and <code>adaptive</code>'
      type: string
    paypal_email_address:
      description: Email Address of the Paypal account.
      type: string
      example: johnsmith@zilliuminc.com
    statement_id:
      description: ID of the Statement Imported
      type: string
      example: '460000000049013'
    from_date:
      description: From Date of the Last Import
      type: string
      example: '2012-01-12'
    to_date:
      description: To Date of the Last Import
      type: string
      example: '2012-01-19'
    source:
      description: Source of the Import
      type: string
      example: csv
    transaction_id:
      description: ID of the transaction
      type: string
      example: '460000000049023'
    debit_or_credit:
      description: Indicates if transaction is  Debit or Credit
      type: string
      example: credit
    date:
      description: Date of the transaction
      type: string
      example: '2012-01-14'
    customer_id:
      description: ID of the Customer involved in the transaction
      type: string
      example: '460000000026049'
    payee:
      description: Payee involved in the transaction
      type: string
      example: Bowman and Co
    reference_number:
      description: Reference Number of the transaction
      type: string
      example: Ref-2134
    transaction_type:
      description: Transaction Type of the transaction
      type: string
      example: expense
    amount:
      description: Amount involved in the transaction
      type: number
      format: double
      example: 7500
    status:
      description: Status of the transaction
      type: string
      example: categorized
    page_context:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/page'
        per_page:
          $ref: '#/components/schemas/per_page'
        has_more_page:
          $ref: '#/components/schemas/has_more_page'
        report_name:
          $ref: '#/components/schemas/report_name'
        applied_filter:
          $ref: '#/components/schemas/applied_filter'
        as_of_date:
          $ref: '#/components/schemas/as_of_date'
        sort_column:
          $ref: '#/components/schemas/sort_column'
        sort_order:
          $ref: '#/components/schemas/sort_order'
    bankaccounts:
      type: array
      items:
        type: object
        properties:
          account_id:
            $ref: '#/components/schemas/account_id'
          account_name:
            $ref: '#/components/schemas/account_name'
          account_code:
            $ref: '#/components/schemas/account_code'
          currency_id:
            $ref: '#/components/schemas/currency_id'
          currency_code:
            $ref: '#/components/schemas/currency_code'
          account_type:
            $ref: '#/components/schemas/account_type'
          uncategorized_transactions:
            $ref: '#/components/schemas/uncategorized_transactions'
          total_unprinted_checks:
            $ref: '#/components/schemas/total_unprinted_checks'
          is_active:
            $ref: '#/components/schemas/is_active'
          balance:
            $ref: '#/components/schemas/balance'
          bank_balance:
            $ref: '#/components/schemas/bank_balance'
          bcy_balance:
            $ref: '#/components/schemas/bcy_balance'
          bank_name:
            $ref: '#/components/schemas/bank_name'
    is_feeds_subscribed:
      description: Check is feeds are subscribed
      type: boolean
      example: false
    is_feeds_active:
      description: Check if feeds are active
      type: boolean
      example: false
    refresh_status_code:
      description: Refresh Status Code of the Bank
      type: string
    feeds_last_refresh_date:
      description: Last Refreshed Date of the Feeds
      type: string
    service_id:
      description: Service ID of the Account
      type: string
    is_system_account:
      description: Check if the account is a system account
      type: boolean
      example: false
    is_show_warning_for_feeds_refresh:
      description: Check if warning should be shown for refreshing Bank Feeds
      type: boolean
      example: false
    bankaccount:
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        account_name:
          $ref: '#/components/schemas/account_name'
        account_code:
          $ref: '#/components/schemas/account_code'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        currency_symbol:
          $ref: '#/components/schemas/currency_symbol'
        price_precision:
          $ref: '#/components/schemas/price_precision'
        account_type:
          $ref: '#/components/schemas/account_type'
        account_number:
          $ref: '#/components/schemas/account_number'
        uncategorized_transactions:
          $ref: '#/components/schemas/uncategorized_transactions'
        total_unprinted_checks:
          $ref: '#/components/schemas/total_unprinted_checks'
        is_active:
          $ref: '#/components/schemas/is_active'
        is_feeds_subscribed:
          $ref: '#/components/schemas/is_feeds_subscribed'
        is_feeds_active:
          $ref: '#/components/schemas/is_feeds_active'
        balance:
          $ref: '#/components/schemas/balance'
        bank_balance:
          $ref: '#/components/schemas/bank_balance'
        bcy_balance:
          $ref: '#/components/schemas/bcy_balance'
        bank_name:
          $ref: '#/components/schemas/bank_name'
        routing_number:
          $ref: '#/components/schemas/routing_number'
        is_primary_account:
          $ref: '#/components/schemas/is_primary_account'
        is_paypal_account:
          $ref: '#/components/schemas/is_paypal_account'
        description:
          $ref: '#/components/schemas/description'
        refresh_status_code:
          $ref: '#/components/schemas/refresh_status_code'
        feeds_last_refresh_date:
          $ref: '#/components/schemas/feeds_last_refresh_date'
        service_id:
          $ref: '#/components/schemas/service_id'
        is_system_account:
          $ref: '#/components/schemas/is_system_account'
        is_show_warning_for_feeds_refresh:
          $ref: '#/components/schemas/is_show_warning_for_feeds_refresh'
    transactions:
      type: array
      description: List of transactions imported through the statement
      items:
        type: object
        properties:
          transaction_id:
            $ref: '#/components/schemas/transaction_id'
          debit_or_credit:
            $ref: '#/components/schemas/debit_or_credit'
          date:
            $ref: '#/components/schemas/date'
          customer_id:
            $ref: '#/components/schemas/customer_id'
          payee:
            $ref: '#/components/schemas/payee'
          reference_number:
            $ref: '#/components/schemas/reference_number'
          transaction_type:
            $ref: '#/components/schemas/transaction_type'
          amount:
            $ref: '#/components/schemas/amount'
          status:
            $ref: '#/components/schemas/status'
    statement:
      type: object
      properties:
        statement_id:
          $ref: '#/components/schemas/statement_id'
        from_date:
          $ref: '#/components/schemas/from_date'
        to_date:
          $ref: '#/components/schemas/to_date'
        source:
          $ref: '#/components/schemas/source'
        transactions:
          $ref: '#/components/schemas/transactions'
    start_date:
      description: Least date in the transaction set
      type: string
      example: '2019-01-01'
    end_date:
      description: Greatest date in the transaction set
      type: string
      example: '2019-01-02'
    create-a-bank-account-request:
      required:
        - account_name
        - account_type
      type: object
      properties:
        account_name:
          $ref: '#/components/schemas/account_name'
        account_type:
          $ref: '#/components/schemas/account_type'
        account_number:
          $ref: '#/components/schemas/account_number'
        account_code:
          $ref: '#/components/schemas/account_code'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        description:
          $ref: '#/components/schemas/description'
        bank_name:
          $ref: '#/components/schemas/bank_name'
        routing_number:
          $ref: '#/components/schemas/routing_number'
        is_primary_account:
          $ref: '#/components/schemas/is_primary_account'
        is_paypal_account:
          $ref: '#/components/schemas/is_paypal_account'
        paypal_type:
          $ref: '#/components/schemas/paypal_type'
        paypal_email_address:
          $ref: '#/components/schemas/paypal_email_address'
    create-a-bank-account-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The account has been created.
          readOnly: true
        bankaccount:
          $ref: '#/components/schemas/bankaccount'
    list-view-of-accounts-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        bankaccounts:
          type: array
          items:
            type: object
            properties:
              account_id:
                $ref: '#/components/schemas/account_id'
              account_name:
                $ref: '#/components/schemas/account_name'
              account_code:
                $ref: '#/components/schemas/account_code'
              currency_id:
                $ref: '#/components/schemas/currency_id'
              currency_code:
                $ref: '#/components/schemas/currency_code'
              account_type:
                $ref: '#/components/schemas/account_type'
              account_number:
                $ref: '#/components/schemas/account_number'
              uncategorized_transactions:
                $ref: '#/components/schemas/uncategorized_transactions'
              total_unprinted_checks:
                $ref: '#/components/schemas/total_unprinted_checks'
              is_active:
                $ref: '#/components/schemas/is_active'
              balance:
                $ref: '#/components/schemas/balance'
              bank_balance:
                $ref: '#/components/schemas/bank_balance'
              bcy_balance:
                $ref: '#/components/schemas/bcy_balance'
              bank_name:
                $ref: '#/components/schemas/bank_name'
              routing_number:
                $ref: '#/components/schemas/routing_number'
              is_primary_account:
                $ref: '#/components/schemas/is_primary_account'
              is_paypal_account:
                $ref: '#/components/schemas/is_paypal_account'
    update-bank-account-request:
      required:
        - account_name
        - account_type
      type: object
      properties:
        account_name:
          $ref: '#/components/schemas/account_name'
        account_type:
          $ref: '#/components/schemas/account_type'
        account_number:
          $ref: '#/components/schemas/account_number'
        account_code:
          $ref: '#/components/schemas/account_code'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        description:
          $ref: '#/components/schemas/description'
        bank_name:
          $ref: '#/components/schemas/bank_name'
        routing_number:
          $ref: '#/components/schemas/routing_number'
        is_primary_account:
          $ref: '#/components/schemas/is_primary_account'
        is_paypal_account:
          $ref: '#/components/schemas/is_paypal_account'
        paypal_type:
          $ref: '#/components/schemas/paypal_type'
        paypal_email_address:
          $ref: '#/components/schemas/paypal_email_address'
    update-bank-account-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The details of the account has been updated.
          readOnly: true
        bankaccount:
          $ref: '#/components/schemas/bankaccount'
    get-account-details-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        bankaccount:
          $ref: '#/components/schemas/bankaccount'
    delete-an-account-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The account has been deleted.
          readOnly: true
    deactivate-account-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The account has been marked as inactive.
          readOnly: true
    activate-account-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The account has been marked as active.
          readOnly: true
    import-a-bankcredit-card-statement-request:
      required:
        - account_id
        - transactions
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        start_date:
          $ref: '#/components/schemas/start_date'
        end_date:
          $ref: '#/components/schemas/end_date'
        transactions:
          type: array
          description: List of bank statement transactions to be imported.
          items:
            type: object
            required:
              - date
              - debit_or_credit
              - amount
            properties:
              transaction_id:
                description: Unique ID that is specific to the transaction
                type: string
                example: XXXXSCD01
              date:
                $ref: '#/components/schemas/date'
              debit_or_credit:
                $ref: '#/components/schemas/debit_or_credit'
              amount:
                $ref: '#/components/schemas/amount'
              payee:
                $ref: '#/components/schemas/payee'
              description:
                description: Transaction description
                type: string
                example: Electronics purchase
              reference_number:
                $ref: '#/components/schemas/reference_number'
    import-a-bankcredit-card-statement-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Your bank statement has been imported.
          readOnly: true
    get-last-imported-statement-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        statement:
          type: array
          items:
            type: object
            properties:
              statement_id:
                $ref: '#/components/schemas/statement_id'
              from_date:
                $ref: '#/components/schemas/from_date'
              to_date:
                $ref: '#/components/schemas/to_date'
              source:
                $ref: '#/components/schemas/source'
              transactions:
                $ref: '#/components/schemas/transactions'
    delete-last-imported-statement-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: You have successfully deleted the last imported statement.
          readOnly: true
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoBooks.banking.CREATE: Create Banking
            ZohoBooks.banking.UPDATE: Update Banking
            ZohoBooks.banking.READ: Read Banking
            ZohoBooks.banking.DELETE: Delete Banking
