code: public void getMargins(KiteConnect kiteConnect) throws KiteException, IOException {
          // Get margins returns margin model, you can pass equity or commodity as arguments to get margins of respective segments.
          //Margins margins = kiteConnect.getMargins("equity");
          Margin margins = kiteConnect.getMargins("equity");
          System.out.println(margins.available.cash);
          System.out.println(margins.utilised.debits);
          System.out.println(margins.utilised.m2mUnrealised);
      }
docs: Gets Margin.