Delete Debt
curl --request DELETE \
--url https://getbill.io/external-api/v1/debts/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://getbill.io/external-api/v1/debts/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://getbill.io/external-api/v1/debts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://getbill.io/external-api/v1/debts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://getbill.io/external-api/v1/debts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://getbill.io/external-api/v1/debts/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Debt deleted successfully"
}
Debts API
Delete Debt
Delete a debt record from the system
DELETE
/
external-api
/
v1
/
debts
/
{id}
Delete Debt
curl --request DELETE \
--url https://getbill.io/external-api/v1/debts/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://getbill.io/external-api/v1/debts/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://getbill.io/external-api/v1/debts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://getbill.io/external-api/v1/debts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://getbill.io/external-api/v1/debts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://getbill.io/external-api/v1/debts/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Debt deleted successfully"
}
Overview
This endpoint permanently removes a debt from your system. Use with caution as this action cannot be undone.Authentication
Requires a valid OAuth 2.0 access token with thedebts:write scope.
Request
string
required
Bearer token for authentication
string
required
The encrypted ID of the debt to delete
Example Request
curl -X DELETE "/external-api/v1/debts/abc123def456" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const debtId = 'abc123def456';
const response = await fetch(`/external-api/v1/debts/${debtId}`, {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
const result = await response.json();
Response
boolean
Always
false for successful requestsstring
Success message confirming deletion
Success Response
{
"error": false,
"message": "Debt deleted successfully"
}
Important Notes
Permanent Action: Deleting a debt is irreversible. All associated followups and history will also be removed.
- All followups associated with this debt will be deleted
- Payment history will be preserved for accounting purposes
- Reports that include this debt will show it as “deleted”
- Consider updating the status instead of deleting for record-keeping
Error Responses
{
"error": true,
"message": "Access denied to this debt",
"code": 403
}
{
"error": true,
"message": "Debt not found or invalid ID",
"code": 404
}