Delete Promise To Pay
Path Parameters
Name
Type
Description
Request Headers
Name
Type
Description
Response Examples
{
"status": "Deleted"
}{
"success": false,
"message": "The Promise To Pay ID is required"
}{
"success": false,
"message": "The Promise To Pay record does not exist"
}Code Samples
<?php
<?php
// API Credentials
$api_username = 'your_username';
$api_password = 'your_password';
$school_id = 'the_school_id';
// The Promise To Pay record ID to be deleted (required)
$id = '12345'; // Replace with the actual ID
// API Endpoint
define('BASE_URL', 'https://integrate.d6plus.co.za/api/v2/finplus/debtmanagement/debtornotes/promisetopays');
$url = BASE_URL . '/' . $id;
// Initialize cURL
$curl = curl_init();
// Set cURL options
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
"HTTP-X-USERNAME: $api_username",
"HTTP-X-PASSWORD: $api_password",
"HTTP-X-SCHOOLID: $school_id"
],
]);
// 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;
Last updated