Financial Transactions Report

Retrieve debtor financial transactions

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

This report provides a comprehensive view of transactions, offering the ability to group data by family/parent while also allowing for further breakdowns per learner using the per_learner parameter. When per_learner is specified, the family/parent object is extended to include learner-specific transaction details. The API supports flexible filtering options, such as date ranges, category IDs, debtor codes, learners, and accountable persons, enabling precise and targeted reporting. Additionally, the all_accounts parameter provides control over whether to include only active accounts or a complete financial history.

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 include a break-down of transactions 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

start_date

String

The start date for filtering transactions (format: YYYY-MM-DD)

end_date

String

The end date for filtering transactions (format: YYYY-MM-DD). The start_date is required when specifying an end date.

Response Examples

[
    {
        "debtor_code": "1001",
        "accountable_person_id": "40",
        "transactions": [
            {
                "category_id": null,
                "category_name": null,
                "transaction_date": "2024-04-01",
                "transaction_type_id": null,
                "transaction_type_name": null,
                "transaction_reference": null,
                "transaction_description": "Opening balance",
                "part_of_base_fee": null,
                "debit_amount": "17200.00",
                "credit_amount": "0.00",
                "accumulated_balance": "17200.00"
            },
            {
                "category_id": "1",
                "category_name": "School Fees",
                "transaction_date": "2024-04-01",
                "transaction_type_id": "14",
                "transaction_type_name": "Debtor Invoice",
                "transaction_reference": "663",
                "transaction_description": "Invoice - School Fees Jordan Smith - 00002 Apr2024",
                "part_of_base_fee": "1",
                "debit_amount": "2000.00",
                "credit_amount": "0.00",
                "accumulated_balance": "19200.00"
            },
            {
                "category_id": "6",
                "category_name": "Hostel Fees",
                "transaction_date": "2024-04-01",
                "transaction_type_id": "14",
                "transaction_type_name": "Debtor Invoice",
                "transaction_reference": "872",
                "transaction_description": "Invoice - Hostel Fees Jordan Smith - 00002 Apr2024",
                "part_of_base_fee": "0",
                "debit_amount": "1000.00",
                "credit_amount": "0.00",
                "accumulated_balance": "20200.00"
            },
            {
                "category_id": "1",
                "category_name": "School Fees",
                "transaction_date": "2024-05-01",
                "transaction_type_id": "14",
                "transaction_type_name": "Debtor Invoice",
                "transaction_reference": "682",
                "transaction_description": "Invoice - School Fees Jordan Smith - 00002 May2024",
                "part_of_base_fee": "1",
                "debit_amount": "2000.00",
                "credit_amount": "0.00",
                "accumulated_balance": "22700.00"
            },
            {
                "category_id": "6",
                "category_name": "Hostel Fees",
                "transaction_date": "2024-05-01",
                "transaction_type_id": "14",
                "transaction_type_name": "Debtor Invoice",
                "transaction_reference": "891",
                "transaction_description": "Invoice - Hostel Fees Jordan Smith - 00002 May2024",
                "part_of_base_fee": "0",
                "debit_amount": "1000.00",
                "credit_amount": "0.00",
                "accumulated_balance": "23700.00"
            }
        ]
    },
    {
        "debtor_code": "1002",
        "accountable_person_id": "3",
        "transactions": [
            {
                "category_id": null,
                "category_name": null,
                "transaction_date": "2024-04-01",
                "transaction_type_id": null,
                "transaction_type_name": null,
                "transaction_reference": null,
                "transaction_description": "Opening balance",
                "part_of_base_fee": null,
                "debit_amount": "21700.00",
                "credit_amount": "0.00",
                "accumulated_balance": "21700.00"
            },
            {
                "category_id": "1",
                "category_name": "School Fees",
                "transaction_date": "2024-04-01",
                "transaction_type_id": "14",
                "transaction_type_name": "Debtor Invoice",
                "transaction_reference": "662",
                "transaction_description": "Invoice - School Fees Nic Webster - 00001 Apr2024",
                "part_of_base_fee": "1",
                "debit_amount": "2000.00",
                "credit_amount": "0.00",
                "accumulated_balance": "23700.00"
            }
        ]
    }
]

Code Samples

<?php

const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/financialtransactions';
const SCHOOL_LOGIN_ID = '1000';
const PARAMS = [
    'per_learner' => 1, 
    'all_accounts' => 1
    ];
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;

Last updated