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 School Debtors

Retrieve debtor financial transactions

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

Use this endpoint to fetch the school debtor accounts.

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

To include learners data in the response use the include_learners query parameter.

Optionally it is possible to filter on a specific 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

all_accounts

Boolean

Whether to include all accounts

include_learners

Boolean

Whether to include the learner data in the response

debtor_code

Integer

To filter on a specific Debtor Code

accountable_person_id

Integer

To filter on a specific Accountable Person ID

Response Examples

[
    {
        "accountable_person_id": "40",
        "title": "Mr",
        "first_name": "John",
        "full_names": "John James",
        "last_name": "Smith",
        "debtor_code": "1001",
        "mobile_calling_code": "27",
        "mobile_number": "0821237654",
        "work_tel_number": "0124567890",
        "home_tel_number": "0123214567",
        "email_address": "jjsmith@example.com",
        "residential_address": "Moneytow Street\r\nNow Village\r\n0123\r\nSouth Africa",
        "postal_address": "Moneytow Street\r\nNow Village\r\n0123\r\nSouth Africa",
        "home_language": "English",
        "nationality": "South Africa",
        "id_number": "8104050240082",
        "passport_number": "A456732243",
        "employer": "Greenholt Group",
        "employer_address": "3 School Lane\r\nBig City\r\nSouth Africa",
        "account_closing_date": "0000-00-00",
        "account_start_date": "2023-01-01"
    }
    {
        "accountable_person_id": "3",
        "title": "Mr",
        "first_name": "Nic",
        "full_names": "Nicholas Nigel",
        "last_name": "Webster",
        "debtor_code": "1002",
        "mobile_calling_code": "27",
        "mobile_number": "0678901234",
        "work_tel_number": "",
        "home_tel_number": "",
        "email_address": "nicnwebster@example.co.za",
        "residential_address": "7th Street\r\nSmall Town\r\n0123\r\nSouth Africa",
        "postal_address": "7th Street\r\nSmall Town\r\n0123\r\nSouth Africa",
        "home_language": "English",
        "nationality": "South Africa",
        "id_number": "",
        "passport_number": "",
        "employer": "",
        "employer_address": "",
        "account_closing_date": "0000-00-00",
        "account_start_date": "2023-01-01"
    }
]
[
    {
        "accountable_person_id": "40",
        "title": "Mr",
        "first_name": "John",
        "full_names": "John James",
        "last_name": "Smith",
        "debtor_code": "1001",
        "mobile_calling_code": "27",
        "mobile_number": "0821237654",
        "work_tel_number": "0124567890",
        "home_tel_number": "0123214567",
        "email_address": "jjsmith@example.com",
        "residential_address": "Moneytow Street\r\nNow Village\r\n0123\r\nSouth Africa",
        "postal_address": "Moneytow Street\r\nNow Village\r\n0123\r\nSouth Africa",
        "home_language": "English",
        "nationality": "South Africa",
        "id_number": "8104050240082",
        "passport_number": "A456732243",
        "employer": "Greenholt Group",
        "employer_address": "3 School Lane\r\nBig City\r\nSouth Africa",
        "account_closing_date": "0000-00-00",
        "account_start_date": "2023-01-01",
        "learners": [
            {
                "learner_id": "1",
                "first_name": "John",
                "last_name": "Smith",
                "gender": "M",
                "grade": "7"
            }
        ]
    },
    {
        "accountable_person_id": "3",
        "title": "Mr",
        "first_name": "Nic",
        "full_names": "Nicholas Nigel",
        "last_name": "Webster",
        "debtor_code": "1002",
        "mobile_calling_code": "27",
        "mobile_number": "0678901234",
        "work_tel_number": "",
        "home_tel_number": "",
        "email_address": "nicnwebster@example.co.za",
        "residential_address": "7th Street\r\nSmall Town\r\n0123\r\nSouth Africa",
        "postal_address": "7th Street\r\nSmall Town\r\n0123\r\nSouth Africa",
        "home_language": "English",
        "nationality": "South Africa",
        "id_number": "",
        "passport_number": "",
        "employer": "",
        "employer_address": "",
        "account_closing_date": "0000-00-00",
        "account_start_date": "2023-01-01",
        "learners": [
            {
                "learner_id": "51",
                "first_name": "Michelle",
                "last_name": "Webster",
                "gender": "F",
                "grade": "3"
            }
        ]
    }
]
{
    "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/schooldebtors';
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/schooldebtors/1000?all_persons=1' \
--header 'HTTP-X-USERNAME: your_username' \
--header 'HTTP-X-PASSWORD: your_password'
PreviousGet SchoolsNextGet Learner Parent Info

Last updated 1 year ago