Get Promise To Pay(s)
Last updated
[
{
"promise_to_pay_id": "8",
"accountable_person_id": "40",
"accountable_person": "Mr James, John",
"debtor_code": "1001",
"debtor_reference": "James",
"date_promised": "2024-03-31",
"amount_promised": "1000.00",
"amount_paid": "1000.00",
"promise_completed": "Yes"
},
{
"promise_to_pay_id": "10",
"accountable_person_id": "40",
"accountable_person": "Mr James, John",
"debtor_code": "1001",
"debtor_reference": "James",
"date_promised": "2024-04-30",
"amount_promised": "1000.00",
"amount_paid": "750.00",
"promise_completed": "Partial"
},
{
"promise_to_pay_id": "12",
"accountable_person_id": "40",
"accountable_person": "Mr James, John",
"debtor_code": "1001",
"debtor_reference": "James",
"date_promised": "2020-05-31",
"amount_promised": "1000.00",
"amount_paid": "",
"promise_completed": "No"
}
][
{
"promise_to_pay_id": "8",
"accountable_person_id": "40",
"accountable_person": "Mr James, John",
"debtor_code": "1001",
"debtor_reference": "James",
"date_promised": "2024-03-31",
"amount_promised": "1000.00",
"amount_paid": "1000.00",
"promise_completed": "Yes",
"debtor_note": {
"note_id": "6",
"date": "2024-03-03",
"note_type_id": "2",
"note_type": "Promise to Pay",
"communication_type_id": "2",
"communication_type": "E-mail",
"note": "Payment arrangement of R1000 to be paid off on outstanding school fees"
}
},
{
"promise_to_pay_id": "10",
"accountable_person_id": "40",
"accountable_person": "Mr James, John",
"debtor_code": "1001",
"debtor_reference": "James",
"date_promised": "2024-04-30",
"amount_promised": "1000.00",
"amount_paid": "750.00",
"promise_completed": "Partial",
"debtor_note": {
"note_id": "6",
"date": "2024-03-03",
"note_type_id": "2",
"note_type": "Promise to Pay",
"communication_type_id": "2",
"communication_type": "E-mail",
"note": "Payment arrangement of R1000 to be paid off on outstanding school fees"
}
},
{
"promise_to_pay_id": "12",
"accountable_person_id": "40",
"accountable_person": "Mr James, John",
"debtor_code": "1001",
"debtor_reference": "James",
"date_promised": "2020-05-31",
"amount_promised": "1000.00",
"amount_paid": "",
"promise_completed": "No",
"debtor_note": {
"note_id": "6",
"date": "2024-03-03",
"note_type_id": "2",
"note_type": "Promise to Pay",
"communication_type_id": "2",
"communication_type": "E-mail",
"note": "Payment arrangement of R1000 to be paid off on outstanding school fees"
}
}
]{
"error": "Not found",
"error_description": "The promise_to_pay_id does not exist"
}{
"error": "Unauthorized",
"error_description": "Client access not authorised"
}{
"error": "Integration not activated",
"error_description": "Please activate the Admin+ API for this client before making this request"
}<?php
const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/finplus/debtmanagement/promisetopays/notes';
const SCHOOL_LOGIN_ID = '1000';
const PARAMS = [
'promise_to_pay_id' => 12,
'accountable_person_id' => 40,
'debtor_code' => 1001,
'promise_completed' => 'Partial',
'year_promised' => 2024,
'include_debtor_note' => 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/debtornotes/promisetopays/1000?```javascript
promise_to_pay_id=291&accountable_person_id=380&debtor_code=1270&promise_completed=Partial&year_promised=2024&include_debtor_note=1
```' \
--header 'HTTP-X-USERNAME: your_username' \
--header 'HTTP-X-PASSWORD: your_password'