Integrate
Integrate v2
Integrate v2
  • Getting Started
    • 🤝Authorisation & Activation
    • 🔗API v2 URL
    • 🔢Versioning
    • 🔐Authentication
    • 🟰Additional Headers
    • 🆗Response Status Codes
    • 🛑Rate Limiting
    • ⁉️Errors and Bad Requests
    • 📖Pagination
    • ⏭️Upgrading to v2
  • Reference
    • Settings
      • Client Integrations
        • Get Client Integrations
        • Change Client Integration State
    • 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 Record(s)
          • Delete Promise To Pay
        • Age Analysis Report
        • Financial Transactions Report
        • Get Schools
        • Get Accountable Person(s)
        • Get Learner(s)
        • Get Transaction Type(s)
        • Get Transaction Category(s)
Powered by GitBook
On this page
  • Request Headers
  • Request Body
  • Request Examples
  • Response Examples
  • Code Samples
  1. Reference
  2. Finance+
  3. Debt Management
  4. Debtor Notes

Create Note

PreviousGet Note(s)NextUpdate Note

POST /v2/finplus/debtmanagement/debtornotes/notes

Use this endpoint to create a new debtor note for a specified school.

  • Accountable Person: The note must be linked to an accountable person, requiring an accountable_person_id. This ID can be retrieved using either the or calls.

  • Note Date: The date of the note must be in "YYYY-MM-DD" format and must fall between the start of last year and the end of next year.

  • Note Type: The note_type_id is required and can be retrieved using the call.

  • Communication Type: The communication_type_id is required for all note types except Internal Notes. This ID can be obtained using the call.

  • Note Content: The actual text of the note should be provided in the note field.

  • Promise to Pay Notes:

    • If creating a Promise to Pay note (note_type_id: 2), payment arrangement details must be included under the promise_to_pays array.

    • A Promise to Pay requires:

      • date_promised: A date between the start of this year and the end of next year.

      • amount_promised: A numeric value without a currency symbol (e.g., "100.00").

The amount_paid value and the promise_completed flag may only be set by the school.

Request Headers

Name
Type
Description

HTTP-X-USERNAME*

String

As provided by d6

HTTP-X-PASSWORD*

String

As provided by d6

HTTP-X-SCHOOLID*

Integer

The unique identifier of the school for which the data is being queried.

Request Body

Name
Type
Description

accountable_person_id*

Integer

The id of the accountable person who the note belongs to.

date*

String

The date of the note in "yyyy-mm-dd" format.

note_type_id*

Integer

The id of the note type.

communication_type_id

Integer

The id of the communication type (not required for internal notes).

note

String

The note text

promise_to_pays

Array

An array of payment arrangement data for promise-to-pay notes

Request Examples

{
    "accountable_person_id": 40,
    "date": "2024-03-03",
    "note_type_id": 2,
    "communication_type_id": 2,
    "note": "Payment arrangement of R1000 to be paid off on outstanding school fees",
    "promise_to_pays": [
        {
            "date_promised": "2024-03-31",
            "amount_promised": "1000.00"
        },
        {
            "date_promised": "2024-04-30",
            "amount_promised": "1000.00"
        },
        {
            "date_promised": "2020-05-31",
            "amount_promised": "1000.00"
        }
    ]
}
{
    "accountable_person_id": 3,
    "date": "2024-04-15",
    "note_type_id": 3,
    "note": "Mr Webster asked to be phoned back tomorrow at 2pm"
}

Response Examples

Status: 201 Created

{
    "success": true,
    "message": "Note created successfully",
    "data": {
        "note_id": 6
    }
}

Status: 201 Created

{
    "success": true,
    "message": "Note created successfully",
    "data": {
        "note_id": 7,
        "promise_to_pays": [
            {
                "promise_to_pay_id": 11,
                "date_promised": "2024-03-31",
                "amount_promised": "1000.00"
            },
            {
                "promise_to_pay_id": 12,
                "date_promised": "2024-04-30",
                "amount_promised": "1000.00"
            },
            {
                "promise_to_pay_id": 13,
                "date_promised": "2020-05-31",
                "amount_promised": "1000.00"
            }
        ]
    }
}

Description: When validation failed for one or more fields

Status: 400 Bad Request

{
    "success": false,
    "message": "Validation Failed",
    "validation_errors": {
        "accountable_person_id": "The accountable_person_id is invalid",
        "date": "The Date is not valid date format. Expected format is 'Y-m-d'.",
        "note": "The Note is required"
    }
}

Code Samples

<?php

// API Credentials
$api_username = 'your_username';
$api_password = 'your_password';
$school_id = 'the_school_id';

// Base API endpoint
define('BASE_URL', 'https://integrate.d6plus.co.za/api/v2/finplus/debtmanagement/debtornotes/notes');

// Request payload
$request_data = [
    "accountable_person_id" => 1234,  // Replace with actual accountable person ID
    "date" => "2025-04-01",           // Note date (YYYY-MM-DD)
    "note_type_id" => 2,              // Replace with actual note type ID
    "communication_type_id" => 1,      // Required unless it's an Internal Note
    "note" => "This is a test debtor note.",
    "promise_to_pays" => [             // Only required if creating a "Promise to Pay" note
        [
            "date_promised" => "2025-05-01",
            "amount_promised" => "1500.00"
        ]
    ]
];

// Initialize cURL
$curl = curl_init();

// Set cURL options
curl_setopt_array($curl, [
    CURLOPT_URL            => BASE_URL,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_POSTFIELDS     => json_encode($request_data),
    CURLOPT_HTTPHEADER     => [
        "HTTP-X-USERNAME: $api_username",
        "HTTP-X-PASSWORD: $api_password",
        "HTTP-X-SCHOOLID: $school_id",
        "Content-Type: application/json"
    ],
]);

// Execute request
$response = curl_exec($curl);

// Check for errors
$error = curl_error($curl);
if ($error) {
    curl_close($curl);
    throw new Exception("cURL Error: $error");
}

// Close cURL and output response
curl_close($curl);
echo $response;

curl --location --request POST 'https://integrate.d6plus.co.za/api/v2/finplus/debtmanagement/debtornotes/notes' \
     --header 'HTTP-X-USERNAME: your_username' \
     --header 'HTTP-X-PASSWORD: your_password' \
     --header 'HTTP-X-SCHOOLID: the_school_id' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "accountable_person_id": 1234,
         "date": "2025-04-01",
         "note_type_id": 2,
         "communication_type_id": 1,
         "note": "This is a test debtor note.",
         "promise_to_pays": [
             {
                 "date_promised": "2025-05-01",
                 "amount_promised": "1500.00"
             }
         ]
     }'
Get Accountable Person(s)
Get Learner(s)
Get Note Type(s)
Get Communication Type(s)