Financial Transactions Report

Retrieve debtor financial transactions

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

Use this endpoint to fetch debtor financial transactions 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 will be grouped by family and parent by default. Use the per_learner query parameter to group the data per learner.

Optionally, it is possible to filter on a specific debtor_code , accountable_person_id or `learner_id`

The transaction_type_idmeans one of the following:

18 - Opening Balance
19 - Closing Balance
20 - System transactions (Invoice / Receipt / etc.)
50 - End of Record

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

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

Response Examples

[
    {
        "debtor_code": "1001",
        "transaction_type_id": "20",
        "transaction_date": "2024-01-01",
        "transaction_type": "Debtor Invoice",
        "transaction_reference": "605",
        "transaction_description": "Invoice - School Fees Jordan Smith - 00001 Jan2024",
        "debit_amount": "2000.00",
        "credit_amount": "0.00",
        "accumulated_balance": "13200.00"
    },
    {
        "debtor_code": "1001",
        "transaction_type_id": "20",
        "transaction_date": "2024-01-01",
        "transaction_type": "Debtor Invoice",
        "transaction_reference": "814",
        "transaction_description": "Invoice - Hostel Fees Jordan Smith - 00001 Jan2024",
        "debit_amount": "1000.00",
        "credit_amount": "0.00",
        "accumulated_balance": "14200.00"
    },
    {
        "debtor_code": "1001",
        "transaction_type_id": "20",
        "transaction_date": "2024-01-01",
        "transaction_type": "Debtor Invoice",
        "transaction_reference": "1023",
        "transaction_description": "Invoice - Aftercare Jordan Smith - 00001 Jan2024",
        "debit_amount": "500.00",
        "credit_amount": "0.00",
        "accumulated_balance": "14700.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