Integrate
Integrate v1
Integrate v1
  • Getting Started
    • Authorisation & Activation
    • API URL
    • Versioning
    • Authentication
    • Response Status Codes
    • Rate Limiting
    • Errors and Bad Requests
  • Reference
    • Settings
      • Clients
        • Get Clients
        • Change Client Integration State
    • Administration+
      • Lookups
        • Ethnic Group(s)
        • Genders
        • Grade(s)
        • Language(s)
        • Marital Status(')
      • School
        • Get School Info
      • Learner
        • Get Learner(s)
        • Get Learner Absentees
        • Get Learner Discipline
      • Parent
        • Get Parent(s)
      • Staff Member
        • Get Staff Member(s)
    • Curriculum+
      • Learner
        • Get Learner Subjects
        • Get Learner Subjects Per Term
        • Get Learner Subject Marks
    • Finance+
      • Debt Management
        • Debtor Notes
          • Get Communication Type(s)
          • Get Note Type(s)
          • Get Note(s)
          • Create Note
          • Update Note
          • Delete Note
          • Get Promise To Pay(s)
          • Delete Promise To Pay
        • Age Analysis Report
        • Financial Transactions Report
        • Get Schools
        • Get School Debtors
        • Get Learner Parent Info
        • Get Transaction Type(s)
        • Get Transaction Category(s)
Powered by GitBook
On this page
  • Get a school's age analysis report
  • Code Samples
  1. Reference
  2. Finance+
  3. Debt Management

Age Analysis Report

Get a school's age analysis report

GET https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/ageanalysis/{school_login_id}

Use this endpoint to generate an age analysis report for the specified school.

By default, only active accounts (current learners or accounts with an outstanding balance) will be returned. You can use the all_accounts query parameter to generate the report for all accounts (includes left learners and 0 balance accounts).

The report, by default, will be grouped by family and parent. Use the per_learner or per_category query parameter to group the data accordingly. If the per_learner and the per_category parameters are used in combination, the results will be grouped per learner, per category.

Additionally it is possible to filter on a specific debtor_code , learner_id , accountable_person_id and/or category_id.

Path Parameters

Name
Type
Description

school_login_id*

Integer

The login ID of the school to retrieve data from

Headers

Name
Type
Description

HTTP-X-USERNAME*

String

As provided by d6

HTTP-X-PASSWORD*

String

As provided by d6

Query Parameters

Name
Type
Description

all_accounts

Boolean

Whether to include all accounts

per_learner

Boolean

Whether to group the data per learner

per_category

Boolean

Whether to group the data per category (can be used in conjunction with per_learner)

debtor_code

Integer

To filter on a specific Debtor Code

learner_id

Integer

To filter on a specific Learner ID

accountable_person_id

Integer

To filter on a specific Accountable Person ID

category_id

Integer

To filter on a specific Category ID

Response Examples

[
    {
        "debtor_code": "1001",
        "accountable_person_id": "40",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "4500.00",
        "balance_total": "25200.00"
    },
    {
        "debtor_code": "1002",
        "accountable_person_id": "3",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "20000.00",
        "balance_total": "40700.00"
    }
]
[
    {
        "debtor_code": "1001",
        "accountable_person_id": "40",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "4500.00",
        "balance_total": "25200.00",
        "learners": [
            {
                "learner_id": "1",
                "learner_first_name": "Jordan",
                "learner_last_name": "Smith",
                "balance_current": "1750.00",
                "balance_30days": "1750.00",
                "balance_60days": "1750.00",
                "balance_90days": "1750.00",
                "balance_120days": "0.00",
                "balance_150days": "850.00",
                "balance_180days": "4500.00",
                "balance_total": "12350.00"
            },
            {
                "learner_id": "2",
                "learner_first_name": "Samantha",
                "learner_last_name": "Smith",
                "balance_current": "1750.00",
                "balance_30days": "1750.00",
                "balance_60days": "1750.00",
                "balance_90days": "1750.00",
                "balance_120days": "850.00",
                "balance_150days": "5000.00",
                "balance_180days": "0.00",
                "balance_total": "12850.00"
            }
        ]
    },
    {
        "family_code": "1002",
        "accountable_person_id": "3",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "20000.00",
        "balance_total": "40700.00",
        "learners": [
            {
                "learner_id": "3",
                "learner_first_name": "Nick",
                "learner_last_name": "Webster",
                "balance_current": "3500.00",
                "balance_30days": "3500.00",
                "balance_60days": "3500.00",
                "balance_90days": "3500.00",
                "balance_120days": "850.00",
                "balance_150days": "5850.00",
                "balance_180days": "20000.00",
                "balance_total": "40700.00",
            }
        ]
    }
]
[
    {
        "debtor_code": "1001",
        "accountable_person_id": "40",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "4500.00",
        "balance_total": "25200.00",
        "categories": [
            {
                "category_id": "1",
                "category_name": "School Fees",
                "balance_current": "2750.00",
                "balance_30days": "2750.00",
                "balance_60days": "2750.00",
                "balance_90days": "2750.00",
                "balance_120days": "0.00",
                "balance_150days": "4500.00",
                "balance_180days": "4500.00",
                "balance_total": "20000.00"
            },
            {
                "category_id": "6",
                "category_name": "Hostel Fees",
                "balance_current": "500.00",
                "balance_30days": "500.00",
                "balance_60days": "500.00",
                "balance_90days": "500.00",
                "balance_120days": "500.00",
                "balance_150days": "500.00",
                "balance_180days": "0.00",
                "balance_total": "3000.00"
            },
            {
                "category_id": "8",
                "category_name": "Sport",
                "balance_current": "250.00",
                "balance_30days": "250.00",
                "balance_60days": "250.00",
                "balance_90days": "250.00",
                "balance_120days": "250.00",
                "balance_150days": "850.00",
                "balance_180days": "0.00",
                "balance_total": "2100.00"
            }
        ]
    },
    {
        "family_code": "1002",
        "accountable_person_id": "3",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "20000.00",
        "balance_total": "40700.00",
        "categories": [
            {
                "category_id": "1",
                "category_name": "School Fees",
                "balance_current": "3500.00",
                "balance_30days": "3500.00",
                "balance_60days": "3500.00",
                "balance_90days": "3500.00",
                "balance_120days": "850.00",
                "balance_150days": "5850.00",
                "balance_180days": "20000.00",
                "balance_total": "40700.00",
            }
        ]
    }
]
[
    {
        "debtor_code": "1001",
        "accountable_person_id": "40",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "4500.00",
        "balance_total": "25200.00",
        "learners": [
            {
                "learner_id": "1",
                "learner_first_name": "Jordan",
                "learner_last_name": "Smith",
                "balance_current": "1750.00",
                "balance_30days": "1750.00",
                "balance_60days": "1750.00",
                "balance_90days": "1750.00",
                "balance_120days": "0.00",
                "balance_150days": "850.00",
                "balance_180days": "4500.00",
                "balance_total": "12350.00",
                "categories": [
                    {
                        "category_id": "1",
                        "category_name": "School Fees",
                        "balance_current": "1000.00",
                        "balance_30days": "1000.00",
                        "balance_60days": "1000.00",
                        "balance_90days": "1000.00",
                        "balance_120days": "0.00",
                        "balance_150days": "0.00",
                        "balance_180days": "4500.00",
                        "balance_total": "8500.00"
                    },
                    {
                        "category_id": "6",
                        "category_name": "Hostel Fees",
                        "balance_current": "500.00",
                        "balance_30days": "500.00",
                        "balance_60days": "500.00",
                        "balance_90days": "500.00",
                        "balance_120days": "0.00",
                        "balance_150days": "500.00",
                        "balance_180days": "0.00",
                        "balance_total": "2500.00"
                    },
                    {
                        "category_id": "8",
                        "category_name": "Sport",
                        "balance_current": "250.00",
                        "balance_30days": "250.00",
                        "balance_60days": "250.00",
                        "balance_90days": "250.00",
                        "balance_120days": "0.00",
                        "balance_150days": "350.00",
                        "balance_180days": "0.00",
                        "balance_total": "1350.00"
                    }
                ]
            },
            {
                "learner_id": "2",
                "learner_first_name": "Samantha",
                "learner_last_name": "Smith",
                "balance_current": "1750.00",
                "balance_30days": "1750.00",
                "balance_60days": "1750.00",
                "balance_90days": "1750.00",
                "balance_120days": "850.00",
                "balance_150days": "5000.00",
                "balance_180days": "0.00",
                "balance_total": "12850.00",
                "categories": [
                    {
                        "category_id": "1",
                        "category_name": "School Fees",
                        "balance_current": "1000.00",
                        "balance_30days": "1000.00",
                        "balance_60days": "1000.00",
                        "balance_90days": "1000.00",
                        "balance_120days": "0.00",
                        "balance_150days": "4500.00",
                        "balance_180days": "0.00",
                        "balance_total": "8500.00"
                    },
                    {
                        "category_id": "6",
                        "category_name": "Hostel Fees",
                        "balance_current": "500.00",
                        "balance_30days": "500.00",
                        "balance_60days": "500.00",
                        "balance_90days": "500.00",
                        "balance_120days": "500.00",
                        "balance_150days": "500.00",
                        "balance_180days": "0.00",
                        "balance_total": "3000.00"
                    },
                    {
                        "category_id": "8",
                        "category_name": "Sport",
                        "balance_current": "250.00",
                        "balance_30days": "250.00",
                        "balance_60days": "250.00",
                        "balance_90days": "250.00",
                        "balance_120days": "350.00",
                        "balance_150days": "0.00",
                        "balance_180days": "0.00",
                        "balance_total": "1350.00"
                    }
                ]
            }
        ]
    },
    {
        "family_code": "1002",
        "accountable_person_id": "3",
        "date": "2024-04-10",
        "balance_current": "3500.00",
        "balance_30days": "3500.00",
        "balance_60days": "3500.00",
        "balance_90days": "3500.00",
        "balance_120days": "850.00",
        "balance_150days": "5850.00",
        "balance_180days": "20000.00",
        "balance_total": "40700.00",
        "learners": [
            {
                "learner_id": "3",
                "learner_first_name": "Nick",
                "learner_last_name": "Webster",
                "balance_current": "3500.00",
                "balance_30days": "3500.00",
                "balance_60days": "3500.00",
                "balance_90days": "3500.00",
                "balance_120days": "850.00",
                "balance_150days": "5850.00",
                "balance_180days": "20000.00",
                "balance_total": "40700.00",
                "categories": [
                    {
                        "category_id": "1",
                        "category_name": "School Fees",
                        "balance_current": "3500.00",
                        "balance_30days": "3500.00",
                        "balance_60days": "3500.00",
                        "balance_90days": "3500.00",
                        "balance_120days": "850.00",
                        "balance_150days": "5850.00",
                        "balance_180days": "20000.00",
                        "balance_total": "40700.00",
                    }
                ]
            }
        ]
    }
]
{
    "error": "Unauthorized",
    "error_description": "Client access not authorised"
}
{
    "error": "Integration not activated",
    "error_description": "Please activate the Finance+ API for this client before making this request"
}

Code Samples

<?php

const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/ageanalysis';
const SCHOOL_LOGIN_ID = '1000';
const PARAMS = [
    'per_learner' => 1, 
    'all_accounts' => 1,
    'debtor_code' => 1001,
    'learner_id' => 2,
    'accountable_person_id' => 3
    ];
const API_USERNAME = getenv('API_USERNAME'); // Assuming you have these environment variables set
const API_PASSWORD = getenv('API_PASSWORD');

$curl = curl_init();

$query = http_build_query(PARAMS);

$options = [
    CURLOPT_URL => BASE_URL . '/' . SCHOOL_LOGIN_ID . '?' . $query,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
        "HTTP-X-USERNAME: " . API_USERNAME,
        "HTTP-X-PASSWORD: " . API_PASSWORD
    ],
];

curl_setopt_array($curl, $options);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    throw new Exception('Curl error: ' . curl_error($curl));
}

curl_close($curl);

echo $response;
curl --location 'https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/ageanalysis/1000?per_learner=1&all_accounts=1&debtor_code=1001&learner_id=2&accountable_person_id=3' \
--header 'HTTP-X-USERNAME: your_username' \
--header 'HTTP-X-PASSWORD: your_password'
PreviousDelete Promise To PayNextFinancial Transactions Report

Last updated 4 months ago