Get Learner Parent Info

Retrieve debtor financial transactions

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

Use this endpoint to fetch a school's learners and optionally include the parent info and the accountable person's details.

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

To include parent info use the include_parents query parameter to include parent info in the response. For including the accountable person's details, use the include_accountable_person query parameter.

Optionally it is possible to filter on a specific learner_id, debtor_code or accountable_person_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

learner_id

Integer

The ID of a specific learner

all_accounts

Boolean

Whether to include all accounts

include_parents

Boolean

Whether to include the parent data in the response

include_accountable_person

Boolean

Whether to include the accountable person's data in the response

learner_id

Integer

To filter on a specific Learner ID

debtor_code

Integer

To filter on a specific Debtor Code

accountable_person_id

Integer

To filter on a specific Accountable Person ID

Response Examples

[
    {
        "learner_id": "1",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "M",
        "grade": "7",
        "debtor_code": "1001",
        "parent1_id": "40",
        "parent2_id": "41",
        "accountable_person_id": "40"
    },
    {
        "learner_id": "2",
        "first_name": "Jane",
        "last_name": "Doe",
        "gender": "F",
        "grade": "5",
        "debtor_code": "1001",
        "parent1_id": "40",
        "parent2_id": "41",
        "accountable_person_id": "40"
    }
]

Code Samples

<?php

const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/learnerparentinfo';
const SCHOOL_LOGIN_ID = '1000';
const PARAMS = [
    'all_persons' => 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