Update Note

Update an existing debtor note

PATCH https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/debtornotes/notes/{school_login_id}

Use this endpoint to update an existing debtor note for the specified school.

The note_id is required and can be found using the Get Note(s) call.

If you need to update the payment arrangements attached to a promise-to-pay note, you must include the updated data in the promise_to_pays array (see below for more information). To update an existing promise-to-pay's data, the promise_to_pay_id needs to be included. This can be found either under the Get Note(s) call or the Get Promise To Pay(s). If a promise_to_pay_id is not included, a new promise-to-pay will be created. The API will not allow a promise-to-pay to be added to the note if the date_promised and amount_promised matches an existing record.

To restore a deleted note, provide the note_id and set the status to "Created".

To see more information about the individual fields, please refer to the Create Note page.

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

Request Body

Name
Type
Description

note_id*

Integer

The id of the debtor note

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

status

String

The status of the note (either "Created" or "Deleted")

promise_to_pays

Array

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

Request Examples

{
    "note_id": "7",
    "date": "2024-04-16",
    "note": "Mr Webster asked to be phoned back tomorrow at 10am"
}

Response Examples

{
    "note_id": "7",
    "accountable_person_id": "3",
    "accountable_person": "Mr Webster, Nic",
    "debtor_code": "1002",
    "debtor_reference": "Webster",
    "date": "2024-04-15",
    "note_type_id": "3",
    "note_type": "Internal",
    "communication_type_id": "7",
    "communication_type": "Internal",
    "note": "Mr Webster asked to be phoned back tomorrow at 10am",
    "status": "Created"
}

Code Samples

<?php

const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/debtornotes/notes';
const SCHOOL_LOGIN_ID = '1000';
const PARAMS = [
    'note_id' => 7,
    'date' => '2024-04-16',
    'note' => 'Mr Webster asked to be phoned back tomorrow at 10am'
];
const API_USERNAME = getenv('API_USERNAME'); // Assuming you have these environment variables set
const API_PASSWORD = getenv('API_PASSWORD');

$curl = curl_init();

$options = [
    CURLOPT_URL => BASE_URL . '/' . SCHOOL_LOGIN_ID,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => true,
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_POSTFIELDS => json_encode(PARAMS),
    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