Get Debtor
curl --request GET \
--url https://getbill.io/external-api/v1/debtors/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://getbill.io/external-api/v1/debtors/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://getbill.io/external-api/v1/debtors/{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/debtors/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/debtors/{id}"
req, _ := http.NewRequest("GET", 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.get("https://getbill.io/external-api/v1/debtors/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debtors/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Success",
"data": {
"data": {
"id": "def456ghi789",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+33612345678",
"address": "123 Main Street, 75001 Paris, France",
"dateOfBirth": "1985-03-15",
"firstSeenAt": "2024-01-15 10:30:00",
"lastSeenAt": "2024-01-20 14:22:00",
"lastUpdatedAt": "2024-01-20 14:22:00",
"totalDebtAmount": 2500.00,
"totalPaidAmount": 750.00,
"averageRepaymentScore": 65,
"debtsCount": 3
}
}
}
Debtors API
Get Debtor
Retrieve detailed information about a specific debtor
GET
/
external-api
/
v1
/
debtors
/
{id}
Get Debtor
curl --request GET \
--url https://getbill.io/external-api/v1/debtors/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://getbill.io/external-api/v1/debtors/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://getbill.io/external-api/v1/debtors/{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/debtors/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/debtors/{id}"
req, _ := http.NewRequest("GET", 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.get("https://getbill.io/external-api/v1/debtors/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debtors/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Success",
"data": {
"data": {
"id": "def456ghi789",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+33612345678",
"address": "123 Main Street, 75001 Paris, France",
"dateOfBirth": "1985-03-15",
"firstSeenAt": "2024-01-15 10:30:00",
"lastSeenAt": "2024-01-20 14:22:00",
"lastUpdatedAt": "2024-01-20 14:22:00",
"totalDebtAmount": 2500.00,
"totalPaidAmount": 750.00,
"averageRepaymentScore": 65,
"debtsCount": 3
}
}
}
Overview
This endpoint returns detailed information about a specific debtor, including aggregated statistics about their debts.Authentication
Requires a valid OAuth 2.0 access token with thedebtors:read scope.
Request
string
required
Bearer token for authentication
Path Parameters
string
required
The encrypted debtor ID
Example Request
curl -X GET "/external-api/v1/debtors/def456ghi789" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"
const debtorId = 'def456ghi789';
const response = await fetch(`/external-api/v1/debtors/${debtorId}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
});
const debtor = await response.json();
import requests
debtor_id = 'def456ghi789'
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(
f'/external-api/v1/debtors/{debtor_id}',
headers=headers
)
debtor = response.json()
Response
boolean
Always
false for successful requestsstring
Success message
object
Response data wrapper
Show data object
Show data object
object
Debtor object with detailed information
Show debtor object
Show debtor object
string
Encrypted debtor identifier
string
Debtor’s first name
string
Debtor’s last name
string
Debtor’s email address
string
Debtor’s phone number (E.164 format)
string
Debtor’s full address
string
Debtor’s date of birth (YYYY-MM-DD format)
string
First time this debtor was seen (YYYY-MM-DD HH:mm:ss format). Read-only.
string
Last time this debtor was seen (YYYY-MM-DD HH:mm:ss format). Read-only.
string
Last update timestamp (YYYY-MM-DD HH:mm:ss format). Read-only.
number
Total amount of all debts for this debtor. Read-only.
number
Total amount paid across all debts. Read-only.
integer
Average repayment score across all debts (0-100). Read-only.
integer
Number of debts for this debtor. Read-only.
Success Response
{
"error": false,
"message": "Success",
"data": {
"data": {
"id": "def456ghi789",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+33612345678",
"address": "123 Main Street, 75001 Paris, France",
"dateOfBirth": "1985-03-15",
"firstSeenAt": "2024-01-15 10:30:00",
"lastSeenAt": "2024-01-20 14:22:00",
"lastUpdatedAt": "2024-01-20 14:22:00",
"totalDebtAmount": 2500.00,
"totalPaidAmount": 750.00,
"averageRepaymentScore": 65,
"debtsCount": 3
}
}
}
Error Responses
{
"error": true,
"message": "Authentication credentials are missing or invalid",
"code": 401
}
{
"error": true,
"message": "Required scope \"debtors:read\" not found in token",
"code": 403
}
{
"error": true,
"message": "Debtor not found or not authorized",
"code": 404
}
Rate Limiting
This endpoint is subject to rate limiting. See the Rate Limits documentation for details. Rate Limit: 1,000 requests per hourRelated Endpoints
- List Debtors - Get a list of all debtors
- Update Debtor - Update debtor information
- List Debts by Debtor - Get all debts for this debtor