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
  • Retrieve debtor financial transactions
  • Code Samples
  1. Reference
  2. Finance+
  3. Debt Management

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"
    }
]
[
    {
        "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",
        "parents": [
            {
                "parent_id": "40",
                "title": "Mr",
                "first_name": "John",
                "full_names": "John James",
                "last_name": "Smith",
                "mobile_calling_code": "27",
                "mobile_number": "0823456789",
                "work_tel_number": "0860010012",
                "home_tel_number": "0123456789",
                "email_address": "jjsmith@example.com",
                "date_of_birth": "1967-02-14",
                "gender": "M",
                "residential_address": "Plot 101\r\nDaffodil Street\r\nPretoria",
                "postal_address": "PO Box 12\r\nMenlyn\r\nPretoria",
                "home_language": "English",
                "nationality": "South Africa",
                "debtor_code": "1001",
                "id_number": "6702145076084",
                "passport_number": "A0176543",
                "employer": "Smith Attorneys",
                "employer_address": "Suite 101\r\nSmith Street\r\nSouth Africa"
            },
            {
                "parent_id": "41",
                "title": "Mrs",
                "first_name": "Jane",
                "full_names": "Jane Jenny",
                "last_name": "Smith",
                "mobile_calling_code": "27",
                "mobile_number": "0798765432",
                "work_tel_number": "0860010012",
                "home_tel_number": "0123456789",
                "email_address": "smith.jj@example.org",
                "date_of_birth": "1955-06-17",
                "gender": "F",
                "residential_address": "Plot 101\r\nDaffodil Street\r\nPretoria",
                "postal_address": "PO Box 12\r\nMenlyn\r\nPretoria",
                "home_language": "English",
                "nationality": "South Africa",
                "debtor_code": "1001",
                "id_number": "5506170079082",
                "passport_number": "",
                "employer": "Smith Attorneys",
                "employer_address": "Suite 101\r\nSmith Street\r\nSouth Africa"
            }
        ]
    },
    {
        "learner_id": "2",
        "first_name": "Jane",
        "last_name": "Doe",
        "gender": "F",
        "grade": "5",
        "debtor_code": "1002",
        "parent1_id": "55",
        "parent2_id": "56",
        "accountable_person_id": "40",
        "parents": [
            {
                "parent_id": "55",
                "title": "Mr",
                "first_name": "Jonathan",
                "full_names": "Jonathan Andrew",
                "last_name": "Doe",
                "mobile_calling_code": "27",
                "mobile_number": "0813456789",
                "work_tel_number": "0860010012",
                "home_tel_number": "0123456789",
                "email_address": "jd@example.com",
                "date_of_birth": "1969-03-11",
                "gender": "M",
                "residential_address": "91 Monument Street\r\nMonument Park\r\nPretoria",
                "postal_address": "PO Box 12\r\nMonument Park\r\nPretoria",
                "home_language": "English",
                "nationality": "South Africa",
                "debtor_code": "1002",
                "id_number": "6903115013085",
                "passport_number": "",
                "employer": "Happy Car Hire",
                "employer_address": "10 Happy Street\r\nJohannesburg\r\nSouth Africa"
            },
            {
                "parent_id": "56",
                "title": "Mrs",
                "first_name": "Janine",
                "full_names": "Janine",
                "last_name": "Doe",
                "mobile_calling_code": "27",
                "mobile_number": "0798124678",
                "work_tel_number": "0860010012",
                "home_tel_number": "0123456789",
                "email_address": "jd2@example.org",
                "date_of_birth": "1984-10-07",
                "gender": "F",
                "residential_address": "91 Monument Street\r\nMonument Park\r\nPretoria",
                "postal_address": "PO Box 12\r\nMonument Park\r\nPretoria",
                "home_language": "English",
                "nationality": "South Africa",
                "debtor_code": "1002",
                "id_number": "8410070079082",
                "passport_number": "",
                "employer": "Happy Car Hire",
                "employer_address": "10 Happy Street\r\nJohannesburg\r\nSouth Africa"
            }
        ]
    }
]
[
    {
        "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",
        "accountable_person": {
            "accountable_person_id": "40",
            "title": "Mr",
            "full_names": "John James",
            "first_name": "John",
            "last_name": "Smith",
            "mobile_calling_code": "27",
            "mobile_number": "0823456789",
            "work_tel_number": "0860010012",
            "home_tel_number": "0123456789",
            "email_address": "jjsmith@example.com",
            "date_of_birth": "1967-02-14",
            "gender": "M",
            "residential_address": "Plot 101\r\nDaffodil Street\r\nPretoria",
            "postal_address": "PO Box 12\r\nMenlyn\r\nPretoria",
            "home_language": "English",
            "nationality": "South Africa",
            "debtor_code": "1001",
            "id_number": "6702145076084",
            "passport_number": "A0176543",
            "employer": "Smith Attorneys",
            "employer_address": "Suite 101\r\nSmith Street\r\nSouth Africa"
        }
    },
    {
        "learner_id": "2",
        "first_name": "Jane",
        "last_name": "Doe",
        "gender": "F",
        "grade": "5",
        "debtor_code": "1002",
        "parent1_id": "55",
        "parent2_id": "56",
        "accountable_person_id": "55",
        "accountable_person": {
            "accountable_person_id": "55",
            "title": "Mr",
            "full_names": "Jonathan Andrew",
            "first_name": "Jonathan",
            "last_name": "Doe",
            "mobile_calling_code": "27",
            "mobile_number": "0813456789",
            "work_tel_number": "0860010012",
            "home_tel_number": "0123456789",
            "email_address": "jd@example.com",
            "date_of_birth": "1969-03-11",
            "gender": "M",
            "residential_address": "91 Monument Street\r\nMonument Park\r\nPretoria",
            "postal_address": "PO Box 12\r\nMonument Park\r\nPretoria",
            "home_language": "English",
            "nationality": "South Africa",
            "debtor_code": "1002",
            "id_number": "6903115013085",
            "passport_number": "",
            "employer": "Happy Car Hire",
            "employer_address": "10 Happy Street\r\nJohannesburg\r\nSouth Africa"
        }
    }
]
{
    "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/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;
curl --location 'https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/learnerparentinfo/1000?all_persons=1' \
--header 'HTTP-X-USERNAME: your_username' \
--header 'HTTP-X-PASSWORD: your_password'
PreviousGet School DebtorsNextGet Transaction Type(s)

Last updated 1 year ago