Create Debt
curl --request POST \
--url https://getbill.io/external-api/v1/debts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"firstname": "<string>",
"lastname": "<string>",
"civility": "<string>",
"phone": "<string>",
"email": "<string>",
"amount": 123,
"currency": "<string>",
"birthdate": "<string>",
"object": "<string>",
"internal_id": "<string>",
"invoice_reference": "<string>",
"credited_invoice_reference": "<string>",
"debtor_reference": "<string>",
"invoice_date": "<string>",
"due_date": "<string>",
"address": "<string>",
"iban": "<string>",
"company": "<string>",
"debtor_company": "<string>",
"street_address": "<string>",
"street_number": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"payment_link": "<string>",
"timeline_id": "<string>",
"timeline_start_mode": "<string>",
"metadata": {},
"accept_expensive_destination": true,
"detect_civility": true,
"validate_emails": true
}
'import requests
url = "https://getbill.io/external-api/v1/debts"
payload = {
"firstname": "<string>",
"lastname": "<string>",
"civility": "<string>",
"phone": "<string>",
"email": "<string>",
"amount": 123,
"currency": "<string>",
"birthdate": "<string>",
"object": "<string>",
"internal_id": "<string>",
"invoice_reference": "<string>",
"credited_invoice_reference": "<string>",
"debtor_reference": "<string>",
"invoice_date": "<string>",
"due_date": "<string>",
"address": "<string>",
"iban": "<string>",
"company": "<string>",
"debtor_company": "<string>",
"street_address": "<string>",
"street_number": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"payment_link": "<string>",
"timeline_id": "<string>",
"timeline_start_mode": "<string>",
"metadata": {},
"accept_expensive_destination": True,
"detect_civility": True,
"validate_emails": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
firstname: '<string>',
lastname: '<string>',
civility: '<string>',
phone: '<string>',
email: '<string>',
amount: 123,
currency: '<string>',
birthdate: '<string>',
object: '<string>',
internal_id: '<string>',
invoice_reference: '<string>',
credited_invoice_reference: '<string>',
debtor_reference: '<string>',
invoice_date: '<string>',
due_date: '<string>',
address: '<string>',
iban: '<string>',
company: '<string>',
debtor_company: '<string>',
street_address: '<string>',
street_number: '<string>',
postal_code: '<string>',
city: '<string>',
country: '<string>',
payment_link: '<string>',
timeline_id: '<string>',
timeline_start_mode: '<string>',
metadata: {},
accept_expensive_destination: true,
detect_civility: true,
validate_emails: true
})
};
fetch('https://getbill.io/external-api/v1/debts', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstname' => '<string>',
'lastname' => '<string>',
'civility' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'amount' => 123,
'currency' => '<string>',
'birthdate' => '<string>',
'object' => '<string>',
'internal_id' => '<string>',
'invoice_reference' => '<string>',
'credited_invoice_reference' => '<string>',
'debtor_reference' => '<string>',
'invoice_date' => '<string>',
'due_date' => '<string>',
'address' => '<string>',
'iban' => '<string>',
'company' => '<string>',
'debtor_company' => '<string>',
'street_address' => '<string>',
'street_number' => '<string>',
'postal_code' => '<string>',
'city' => '<string>',
'country' => '<string>',
'payment_link' => '<string>',
'timeline_id' => '<string>',
'timeline_start_mode' => '<string>',
'metadata' => [
],
'accept_expensive_destination' => true,
'detect_civility' => true,
'validate_emails' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://getbill.io/external-api/v1/debts"
payload := strings.NewReader("{\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\",\n \"civility\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"birthdate\": \"<string>\",\n \"object\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"credited_invoice_reference\": \"<string>\",\n \"debtor_reference\": \"<string>\",\n \"invoice_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"address\": \"<string>\",\n \"iban\": \"<string>\",\n \"company\": \"<string>\",\n \"debtor_company\": \"<string>\",\n \"street_address\": \"<string>\",\n \"street_number\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"timeline_id\": \"<string>\",\n \"timeline_start_mode\": \"<string>\",\n \"metadata\": {},\n \"accept_expensive_destination\": true,\n \"detect_civility\": true,\n \"validate_emails\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://getbill.io/external-api/v1/debts")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\",\n \"civility\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"birthdate\": \"<string>\",\n \"object\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"credited_invoice_reference\": \"<string>\",\n \"debtor_reference\": \"<string>\",\n \"invoice_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"address\": \"<string>\",\n \"iban\": \"<string>\",\n \"company\": \"<string>\",\n \"debtor_company\": \"<string>\",\n \"street_address\": \"<string>\",\n \"street_number\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"timeline_id\": \"<string>\",\n \"timeline_start_mode\": \"<string>\",\n \"metadata\": {},\n \"accept_expensive_destination\": true,\n \"detect_civility\": true,\n \"validate_emails\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\",\n \"civility\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"birthdate\": \"<string>\",\n \"object\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"credited_invoice_reference\": \"<string>\",\n \"debtor_reference\": \"<string>\",\n \"invoice_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"address\": \"<string>\",\n \"iban\": \"<string>\",\n \"company\": \"<string>\",\n \"debtor_company\": \"<string>\",\n \"street_address\": \"<string>\",\n \"street_number\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"timeline_id\": \"<string>\",\n \"timeline_start_mode\": \"<string>\",\n \"metadata\": {},\n \"accept_expensive_destination\": true,\n \"detect_civility\": true,\n \"validate_emails\": true\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Debt created successfully",
"data": {
"id": "abc123def456",
"civility": "Mr",
"firstname": "John",
"lastname": "Doe",
"phone": "+33123456789",
"email": "john.doe@example.com",
"email_validation": {
"status": "valid",
"reason": "accepted_email",
"charged": true,
"email": "john.doe@example.com"
},
"birthdate": "1985-03-15",
"amount": 1250.00,
"amount_text": "1250.00",
"currency": "EUR",
"object": "Outstanding invoice #INV-2024-001",
"internal_id": "DEBT-2024-001",
"invoice_reference": "INV-2024-001",
"debtor_reference": "DEB-DOE-001",
"invoice_date": "2023-12-01",
"due_date": "2023-12-31",
"address": "123 Main Street, 75001 Paris, France",
"street_address": null,
"street_number": null,
"postal_code": null,
"city": null,
"country": null,
"status": "status.default.pending",
"timeline_id": "YOUR_TIMELINE_ID",
"nb_reminders": 0,
"nb_answered": 0,
"summary": null,
"iban": "FR1420041010050500013M02606",
"followups_count": 0,
"company": "Acme Corp",
"debtor_company": "ACME Corporation",
"payment_link": null,
"metadata": {"crm_id": "CRM-123", "source": "website", "priority": "high"},
"import_date": "2024-01-22T10:30:00+00:00",
"last_timeline_restart": null,
"payment_plan_active": false,
"plan_start_date": null
}
}
Debts API
Create Debt
Create a debt or credit note
POST
/
external-api
/
v1
/
debts
Create Debt
curl --request POST \
--url https://getbill.io/external-api/v1/debts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"firstname": "<string>",
"lastname": "<string>",
"civility": "<string>",
"phone": "<string>",
"email": "<string>",
"amount": 123,
"currency": "<string>",
"birthdate": "<string>",
"object": "<string>",
"internal_id": "<string>",
"invoice_reference": "<string>",
"credited_invoice_reference": "<string>",
"debtor_reference": "<string>",
"invoice_date": "<string>",
"due_date": "<string>",
"address": "<string>",
"iban": "<string>",
"company": "<string>",
"debtor_company": "<string>",
"street_address": "<string>",
"street_number": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"payment_link": "<string>",
"timeline_id": "<string>",
"timeline_start_mode": "<string>",
"metadata": {},
"accept_expensive_destination": true,
"detect_civility": true,
"validate_emails": true
}
'import requests
url = "https://getbill.io/external-api/v1/debts"
payload = {
"firstname": "<string>",
"lastname": "<string>",
"civility": "<string>",
"phone": "<string>",
"email": "<string>",
"amount": 123,
"currency": "<string>",
"birthdate": "<string>",
"object": "<string>",
"internal_id": "<string>",
"invoice_reference": "<string>",
"credited_invoice_reference": "<string>",
"debtor_reference": "<string>",
"invoice_date": "<string>",
"due_date": "<string>",
"address": "<string>",
"iban": "<string>",
"company": "<string>",
"debtor_company": "<string>",
"street_address": "<string>",
"street_number": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"payment_link": "<string>",
"timeline_id": "<string>",
"timeline_start_mode": "<string>",
"metadata": {},
"accept_expensive_destination": True,
"detect_civility": True,
"validate_emails": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
firstname: '<string>',
lastname: '<string>',
civility: '<string>',
phone: '<string>',
email: '<string>',
amount: 123,
currency: '<string>',
birthdate: '<string>',
object: '<string>',
internal_id: '<string>',
invoice_reference: '<string>',
credited_invoice_reference: '<string>',
debtor_reference: '<string>',
invoice_date: '<string>',
due_date: '<string>',
address: '<string>',
iban: '<string>',
company: '<string>',
debtor_company: '<string>',
street_address: '<string>',
street_number: '<string>',
postal_code: '<string>',
city: '<string>',
country: '<string>',
payment_link: '<string>',
timeline_id: '<string>',
timeline_start_mode: '<string>',
metadata: {},
accept_expensive_destination: true,
detect_civility: true,
validate_emails: true
})
};
fetch('https://getbill.io/external-api/v1/debts', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstname' => '<string>',
'lastname' => '<string>',
'civility' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'amount' => 123,
'currency' => '<string>',
'birthdate' => '<string>',
'object' => '<string>',
'internal_id' => '<string>',
'invoice_reference' => '<string>',
'credited_invoice_reference' => '<string>',
'debtor_reference' => '<string>',
'invoice_date' => '<string>',
'due_date' => '<string>',
'address' => '<string>',
'iban' => '<string>',
'company' => '<string>',
'debtor_company' => '<string>',
'street_address' => '<string>',
'street_number' => '<string>',
'postal_code' => '<string>',
'city' => '<string>',
'country' => '<string>',
'payment_link' => '<string>',
'timeline_id' => '<string>',
'timeline_start_mode' => '<string>',
'metadata' => [
],
'accept_expensive_destination' => true,
'detect_civility' => true,
'validate_emails' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://getbill.io/external-api/v1/debts"
payload := strings.NewReader("{\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\",\n \"civility\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"birthdate\": \"<string>\",\n \"object\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"credited_invoice_reference\": \"<string>\",\n \"debtor_reference\": \"<string>\",\n \"invoice_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"address\": \"<string>\",\n \"iban\": \"<string>\",\n \"company\": \"<string>\",\n \"debtor_company\": \"<string>\",\n \"street_address\": \"<string>\",\n \"street_number\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"timeline_id\": \"<string>\",\n \"timeline_start_mode\": \"<string>\",\n \"metadata\": {},\n \"accept_expensive_destination\": true,\n \"detect_civility\": true,\n \"validate_emails\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://getbill.io/external-api/v1/debts")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\",\n \"civility\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"birthdate\": \"<string>\",\n \"object\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"credited_invoice_reference\": \"<string>\",\n \"debtor_reference\": \"<string>\",\n \"invoice_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"address\": \"<string>\",\n \"iban\": \"<string>\",\n \"company\": \"<string>\",\n \"debtor_company\": \"<string>\",\n \"street_address\": \"<string>\",\n \"street_number\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"timeline_id\": \"<string>\",\n \"timeline_start_mode\": \"<string>\",\n \"metadata\": {},\n \"accept_expensive_destination\": true,\n \"detect_civility\": true,\n \"validate_emails\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\",\n \"civility\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"birthdate\": \"<string>\",\n \"object\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"credited_invoice_reference\": \"<string>\",\n \"debtor_reference\": \"<string>\",\n \"invoice_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"address\": \"<string>\",\n \"iban\": \"<string>\",\n \"company\": \"<string>\",\n \"debtor_company\": \"<string>\",\n \"street_address\": \"<string>\",\n \"street_number\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"timeline_id\": \"<string>\",\n \"timeline_start_mode\": \"<string>\",\n \"metadata\": {},\n \"accept_expensive_destination\": true,\n \"detect_civility\": true,\n \"validate_emails\": true\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Debt created successfully",
"data": {
"id": "abc123def456",
"civility": "Mr",
"firstname": "John",
"lastname": "Doe",
"phone": "+33123456789",
"email": "john.doe@example.com",
"email_validation": {
"status": "valid",
"reason": "accepted_email",
"charged": true,
"email": "john.doe@example.com"
},
"birthdate": "1985-03-15",
"amount": 1250.00,
"amount_text": "1250.00",
"currency": "EUR",
"object": "Outstanding invoice #INV-2024-001",
"internal_id": "DEBT-2024-001",
"invoice_reference": "INV-2024-001",
"debtor_reference": "DEB-DOE-001",
"invoice_date": "2023-12-01",
"due_date": "2023-12-31",
"address": "123 Main Street, 75001 Paris, France",
"street_address": null,
"street_number": null,
"postal_code": null,
"city": null,
"country": null,
"status": "status.default.pending",
"timeline_id": "YOUR_TIMELINE_ID",
"nb_reminders": 0,
"nb_answered": 0,
"summary": null,
"iban": "FR1420041010050500013M02606",
"followups_count": 0,
"company": "Acme Corp",
"debtor_company": "ACME Corporation",
"payment_link": null,
"metadata": {"crm_id": "CRM-123", "source": "website", "priority": "high"},
"import_date": "2024-01-22T10:30:00+00:00",
"last_timeline_restart": null,
"payment_plan_active": false,
"plan_start_date": null
}
}
Overview
This endpoint creates a debt or records a credit note. A positiveamount creates a debt; a negative amount creates or updates a credit note.
Authentication
Requires a valid OAuth 2.0 access token with thedebts:write scope.
Request
string
required
Bearer token for authentication
string
required
Must be
application/jsonRequest Body
string
Debtor’s first name. Required for debts; optional for credit notes.
string
Debtor’s last name. Required for debts; optional for credit notes.
string
Civility/title (optional). Possible values:
"Mr" or "Ms"string
Debtor’s phone number (international format recommended). For debts, at least one of phone or email must be valid. Optional for credit notes. Note: French overseas mobile numbers with 069X prefix are not supported.
string
Debtor’s email address. For debts, at least one of phone or email must be valid. Optional for credit notes.
number
required
Positive debt amount or negative credit note amount. Zero is invalid.
string
required
Currency code (ISO 4217 format, e.g., “EUR”, “USD”)
string
Debtor’s birth date in YYYY-MM-DD format (optional)
string
Description of what the debt is for (optional)
string
Your internal reference ID. For a credit note, either
internal_id or invoice_reference is required as its stable identity.string
Invoice reference number. For a credit note, either
internal_id or invoice_reference is required as its stable identity.string
Invoice reference to credit. For a credit note, either
credited_invoice_reference or debtor_reference is required as its target.string
Your reference for the debtor. For a credit note, either
credited_invoice_reference or debtor_reference is required as its target. When a credit note targets only debtor_reference, provide timeline_id unless your company has exactly one timeline.string
Original invoice date in YYYY-MM-DD format (optional)
string
Payment due date in YYYY-MM-DD format (optional)
string
Debtor’s full address (optional)
string
IBAN where payment should be made (optional)
string
Name of the creditor company you are collecting on behalf of (optional). Only used by debt collection agencies who manage debts for multiple client companies. If you are collecting your own debts, leave this field empty.
string
Debtor’s company name, if the debtor is a business (optional)
string
Street address (optional). Can be used with other address fields for structured address data
string
Street number (optional)
string
Postal/ZIP code (optional)
string
City name (optional)
string
Country code in ISO 3166-1 alpha-2 format, e.g. “FR”, “US” (optional)
string
Custom payment link URL for this debt (optional)
string
Encrypted timeline ID to associate with this debt (optional). It is required for a credit note that targets only
debtor_reference when your company has multiple timelines. Credit notes that target credited_invoice_reference can infer the timeline from the matching invoice. When provided, the debt will be automatically processed according to the timeline’s actions (calls, emails, SMS, etc.). Use this to enable AI-powered collection workflows.How to get timeline IDs: See the Using Timelines guide for detailed instructions. You must be a company administrator and have created an OAuth client to view timeline IDs in your dashboard.string
Controls when the timeline processing should start (optional). Only used when
timeline_id is provided. Options:"immediate"(default): Start processing immediately using the import date"next_day": Start processing on the next allowed business day (respects timeline’s excluded days and public holidays)
object
Custom metadata object for storing arbitrary JSON data (optional). Use this to store any additional information that your system needs to track, such as CRM IDs, order references, custom tags, or integration-specific data. This field is returned in API responses and webhook payloads.
boolean
Controls phone communications to destinations whose configured AI-call price is at least 50 credits. Set
true to allow them. Set false to restrict SMS, RCS, calls, WhatsApp, and voicemail for that phone while retaining the debt and allowing email and postal reminders. For a new phone, omitting the field has the same restrictive effect. For an unchanged existing phone, omission preserves its recorded choice. The field accepts JSON booleans only. For debt synchronized through a campaign, the GetBill campaign configuration takes priority.boolean
Enables automatic civility/title completion when
civility is missing and firstname is present. Default: true. Charged at 1 credit per 100 debts needing civility detection, rounded up.boolean
Enables email deliverability validation for the provided email address. Default:
false. Charged at 1 credit per 5 billable validation results. Invalid addresses are saved but marked as suppressed to prevent sending.For a credit note, send a negative
amount, one identity field (internal_id or invoice_reference), and one target field (credited_invoice_reference or debtor_reference). A debtor-only target also requires timeline_id unless your company has exactly one timeline. Debtor names and contact details are not required.Example Request
curl -X POST "/external-api/v1/debts" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstname": "John",
"lastname": "Doe",
"civility": "Mr",
"phone": "+33123456789",
"email": "john.doe@example.com",
"birthdate": "1985-03-15",
"amount": 1250.00,
"currency": "EUR",
"object": "Outstanding invoice #INV-2024-001",
"internal_id": "DEBT-2024-001",
"invoice_reference": "INV-2024-001",
"debtor_reference": "DEB-DOE-001",
"invoice_date": "2023-12-01",
"due_date": "2023-12-31",
"address": "123 Main Street, 75001 Paris, France",
"iban": "FR1420041010050500013M02606",
"company": "Acme Corp",
"timeline_id": "YOUR_TIMELINE_ID",
"timeline_start_mode": "next_day",
"detect_civility": true,
"validate_emails": false,
"metadata": {"crm_id": "CRM-123", "source": "website", "priority": "high"}
}'
const debtData = {
firstname: "John",
lastname: "Doe",
civility: "Mr",
phone: "+33123456789",
email: "john.doe@example.com",
birthdate: "1985-03-15",
amount: 1250.00,
currency: "EUR",
object: "Outstanding invoice #INV-2024-001",
internal_id: "DEBT-2024-001",
invoice_reference: "INV-2024-001",
debtor_reference: "DEB-DOE-001",
invoice_date: "2023-12-01",
due_date: "2023-12-31",
address: "123 Main Street, 75001 Paris, France",
iban: "FR1420041010050500013M02606",
company: "Acme Corp",
debtor_company: "ACME Corporation",
timeline_id: "YOUR_TIMELINE_ID",
timeline_start_mode: "next_day",
detect_civility: true,
validate_emails: false,
metadata: { crm_id: "CRM-123", source: "website", priority: "high" }
};
const response = await fetch('/external-api/v1/debts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify(debtData)
});
const result = await response.json();
import requests
debt_data = {
"firstname": "John",
"lastname": "Doe",
"civility": "Mr",
"phone": "+33123456789",
"email": "john.doe@example.com",
"birthdate": "1985-03-15",
"amount": 1250.00,
"currency": "EUR",
"object": "Outstanding invoice #INV-2024-001",
"internal_id": "DEBT-2024-001",
"invoice_reference": "INV-2024-001",
"debtor_reference": "DEB-DOE-001",
"invoice_date": "2023-12-01",
"due_date": "2023-12-31",
"address": "123 Main Street, 75001 Paris, France",
"iban": "FR1420041010050500013M02606",
"company": "Acme Corp",
"timeline_id": "YOUR_TIMELINE_ID",
"timeline_start_mode": "next_day",
"detect_civility": True,
"validate_emails": False,
"metadata": {"crm_id": "CRM-123", "source": "website", "priority": "high"}
}
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
response = requests.post(
'/external-api/v1/debts',
headers=headers,
json=debt_data
)
result = response.json()
Response
boolean
Always
false for successful requestsstring
Success message
object
The created debt object or credit note result
Show credit note object
Show credit note object
string
Always
"credit_note"integer
Credit note identifier
string
Stable identity supplied through
internal_id or invoice_referencestring
"applied" when matched to a debt or group, otherwise "pending"number
Remaining accounting balance after the credit, or
null while pendingnumber
Remaining collectible amount after the credit, or
null while pendingShow debt object
Show debt object
string
Encrypted debt identifier (use this for subsequent API calls)
boolean
Whether the created debt belongs to a group containing multiple non-archived debts
array
Encrypted IDs of the debts in the group. For an ungrouped debt, this contains only its own ID.
string
Debtor’s first name
string
Debtor’s last name
string
Civility/title
string
Debtor’s phone number
string
Debtor’s email address
object
Present only when
validate_emails is true and the debt has an email address. Contains status (valid, invalid, or unverifiable), reason, charged, and email.string
Debtor’s birth date (YYYY-MM-DD format)
number
Debt amount
string
Debt amount as text
string
Currency code
string
Description of the debt
string
Your internal reference ID
string
Invoice reference number
string
Your reference for the debtor
string
Original invoice date (YYYY-MM-DD format)
string
Payment due date (YYYY-MM-DD format)
string
Debtor’s full address
string
Street address
string
Street number
string
Postal/ZIP code
string
City name
string
Country code (ISO 3166-1 alpha-2)
string
Current debt status (always “Pending” for newly created debts). Read-only - changes through internal workflows only.
integer
Number of reminders sent (initially 0)
integer
Number of responses received (initially 0)
string
Summary or notes
string
IBAN for payment
string
Encrypted timeline ID associated with this debt (null if no timeline)
integer
Number of followups (initially 0)
string
Creditor company name (only present for debt collection agencies collecting on behalf of other companies)
string
Debtor’s company name (for B2B debts)
string
Custom payment link URL for this debt
object
Custom metadata object containing arbitrary JSON data. Returns null if no metadata was provided.
string
Creation/import timestamp (ISO 8601 format). Read-only - automatically set by the system.
string
Timestamp of last timeline restart (ISO 8601 format). Read-only - managed by the system based on
timeline_start_mode and internal workflows.boolean
Whether the debt has an active payment plan
string
Payment plan start date (YYYY-MM-DD format), null if no plan
Success Response
{
"error": false,
"message": "Debt created successfully",
"data": {
"id": "abc123def456",
"civility": "Mr",
"firstname": "John",
"lastname": "Doe",
"phone": "+33123456789",
"email": "john.doe@example.com",
"email_validation": {
"status": "valid",
"reason": "accepted_email",
"charged": true,
"email": "john.doe@example.com"
},
"birthdate": "1985-03-15",
"amount": 1250.00,
"amount_text": "1250.00",
"currency": "EUR",
"object": "Outstanding invoice #INV-2024-001",
"internal_id": "DEBT-2024-001",
"invoice_reference": "INV-2024-001",
"debtor_reference": "DEB-DOE-001",
"invoice_date": "2023-12-01",
"due_date": "2023-12-31",
"address": "123 Main Street, 75001 Paris, France",
"street_address": null,
"street_number": null,
"postal_code": null,
"city": null,
"country": null,
"status": "status.default.pending",
"timeline_id": "YOUR_TIMELINE_ID",
"nb_reminders": 0,
"nb_answered": 0,
"summary": null,
"iban": "FR1420041010050500013M02606",
"followups_count": 0,
"company": "Acme Corp",
"debtor_company": "ACME Corporation",
"payment_link": null,
"metadata": {"crm_id": "CRM-123", "source": "website", "priority": "high"},
"import_date": "2024-01-22T10:30:00+00:00",
"last_timeline_restart": null,
"payment_plan_active": false,
"plan_start_date": null
}
}
Error Responses
{
"error": true,
"message": "Validation failed",
"code": 400,
"details": {
"firstname": "First name is required",
"lastname": "Last name is required",
"amount": "Valid amount (greater than 0) is required",
"contact": "At least one valid contact method (email or phone) is required",
"phone": "Invalid phone number"
}
}
{
"error": true,
"message": "Invalid phone number: \"12345\" - phone number too short",
"code": 400
}
{
"error": true,
"message": "Authentication credentials are missing or invalid",
"code": 401
}
{
"error": true,
"message": "Required scope \"debts:write\" not found in token",
"code": 403
}
{
"error": true,
"message": "Failed to create debt",
"code": 500
}
Validation Rules
Validation Update (2025): Phone number validation is now strictly enforced to match the web interface behavior. Phone numbers are validated using international standards (libphonenumber library). If you were previously sending phone numbers without proper formatting or French overseas mobile numbers (069X prefix), these will now be rejected. You can now use
email as an alternative to phone.Required Fields
Required Fields
Debt (
amount > 0):firstnameandlastname: Must not be emptyphoneoremail: At least one valid contact method
amount < 0):internal_idorinvoice_reference: Stable credit note identitycredited_invoice_referenceordebtor_reference: Debt targettimeline_id: Required for a debtor-only target unless the company has exactly one timeline
amount must not be zero and currency must be a valid ISO 4217 currency code.Debt Contact Information (At Least One Required)
Debt Contact Information (At Least One Required)
At least one valid contact method is required:
phone: Must be a valid phone number if provided- Supported: French mainland numbers, most international numbers, French overseas fixed lines
- NOT Supported: French overseas mobile numbers with 069X prefix (e.g.,
0690123456) - International format recommended (e.g.,
+33123456789)
email: Must be a valid email format if provided
- If only phone is provided, it must be valid
- If only email is provided, it must be valid
- If both are provided, at least one must be valid
- If neither is valid, the request will fail
Format Validation
Format Validation
birthdate: Must be in YYYY-MM-DD format if providedinvoice_date: Must be in YYYY-MM-DD format if provideddue_date: Must be in YYYY-MM-DD format if providedphone: Validated and normalized to E.164 format. International format recommended (e.g., +33123456789). French numbers without country code (e.g., 0612345678 or 612345678) are automatically normalized to +33 format.iban: Must be a valid IBAN if provided
Phone Validation
Phone Validation
Phone numbers are validated against carrier databases. Invalid phones will be rejected with a specific error message:
"phone number too short"- Number has too few digits"phone number too long"- Number has too many digits"invalid country code"- Country code not recognized"number format is not valid"- Number doesn’t match expected format"number not registered in carrier database"- Number range not allocated to any carrier (may affect some overseas territories)
Business Rules
Business Rules
amount: Must be positive for a debt or negative for a credit note; zero is invaliddue_date: Should be afterinvoice_dateif both are providedinternal_id: Should be unique within your company (recommended)currency: Must be supported by the systemstatus: Automatically set to “pending” on creation. Status cannot be set via API and will change through internal workflows only.timeline_id: Must be a valid encrypted timeline ID belonging to your companytimeline_start_mode: Only used whentimeline_idis provided- Invalid timeline IDs are ignored for debts and rejected for credit notes
Expensive Destinations
Expensive Destinations
A costly phone destination does not reject an otherwise valid debt. The successful response includes an Send
expensive_destination_not_accepted warning when phone communications are restricted. The restriction applies only to that phone, including secondary-contact phones; email and postal reminders keep their normal behavior.{
"warnings": [{
"code": "expensive_destination_not_accepted",
"message": "Debt accepted; phone communications restricted for an expensive destination.",
"field": "phone",
"blocked_channels": ["sms", "rcs", "call", "whatsapp", "voicemail"]
}]
}
"accept_expensive_destination": true to permit the costly phone communications. Send false to restrict them explicitly. This is based on configured pricing, not on whether a number is foreign.Rate Limiting
This endpoint is subject to rate limiting. See the Rate Limits documentation for details. Rate Limit: 500 requests per hour (write operations)Best Practices
Use Internal IDs
Always provide an
internal_id to link the debt to your own systems and avoid duplicates.Validate Data
Validate all data on your side before sending to reduce API errors and improve performance.
Handle Errors
Implement proper error handling to deal with validation failures and network issues.
Store Debt IDs
Store the returned encrypted
id for future API calls - it’s the primary identifier.Enable AI Workflows
Use
timeline_id to automatically trigger AI-powered collection actions (calls, emails, SMS) based on your timeline configuration.Control Start Timing
Use
timeline_start_mode: "next_day" to respect business hours and excluded days when starting the collection process.After Creation
Once a debt is created, you can:- Start followup activities using the Followups API
- Update debt information using the Update Debt endpoint
- Track collection progress by retrieving followup statistics
- Generate reports that include this debt in your analytics
Related Endpoints
- List Debts - Get all debts for your company
- Get Debt - Retrieve a specific debt
- Update Debt - Modify debt information
- Create Followup - Start collection activities