Upload Invoice Document For Debt
curl --request POST \
--url https://getbill.io/external-api/v1/debts/{id}/invoice-document \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"replace_manual": true
}
'import requests
url = "https://getbill.io/external-api/v1/debts/{id}/invoice-document"
payload = { "replace_manual": 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({replace_manual: true})
};
fetch('https://getbill.io/external-api/v1/debts/{id}/invoice-document', 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}/invoice-document",
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([
'replace_manual' => 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/{id}/invoice-document"
payload := strings.NewReader("{\n \"replace_manual\": 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/{id}/invoice-document")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"replace_manual\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debts/{id}/invoice-document")
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 \"replace_manual\": true\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Invoice document uploaded successfully",
"data": {
"id": "document_encrypted_id",
"debt_id": "debt_encrypted_id",
"internal_id": "DEBT-2026-001",
"invoice_reference": "INV-2026-001",
"original_filename": "invoice.pdf",
"status": "active",
"match_method": "manual",
"created_at": "2026-07-04T10:30:00+00:00"
}
}
Invoice documents API
Upload Invoice Document For Debt
Attach a PDF invoice document to an existing debt
POST
/
external-api
/
v1
/
debts
/
{id}
/
invoice-document
Upload Invoice Document For Debt
curl --request POST \
--url https://getbill.io/external-api/v1/debts/{id}/invoice-document \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"replace_manual": true
}
'import requests
url = "https://getbill.io/external-api/v1/debts/{id}/invoice-document"
payload = { "replace_manual": 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({replace_manual: true})
};
fetch('https://getbill.io/external-api/v1/debts/{id}/invoice-document', 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}/invoice-document",
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([
'replace_manual' => 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/{id}/invoice-document"
payload := strings.NewReader("{\n \"replace_manual\": 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/{id}/invoice-document")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"replace_manual\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/debts/{id}/invoice-document")
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 \"replace_manual\": true\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Invoice document uploaded successfully",
"data": {
"id": "document_encrypted_id",
"debt_id": "debt_encrypted_id",
"internal_id": "DEBT-2026-001",
"invoice_reference": "INV-2026-001",
"original_filename": "invoice.pdf",
"status": "active",
"match_method": "manual",
"created_at": "2026-07-04T10:30:00+00:00"
}
}
Overview
Upload a PDF invoice document and attach it directly to a debt using the debt’s stable encrypted API ID. This endpoint is intended for the two-step flow: create or update the debt first, then upload the invoice PDF for that debt.Authentication
Requires a valid OAuth 2.0 access token with theinvoice_documents:write scope. The legacy debts:write scope is also accepted during the transition.
Request
string
required
Bearer token for authentication
string
required
Must be
multipart/form-datastring
required
Stable encrypted debt ID returned by the Debts API
file
required
PDF invoice file. Maximum size: 25 MB.
boolean
Set to
true to replace an existing manually uploaded invoice document. Default: false.Example Request
curl
curl -X POST "/external-api/v1/debts/debt_encrypted_id/invoice-document" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "invoice=@./invoice.pdf;type=application/pdf"
Success Response
{
"error": false,
"message": "Invoice document uploaded successfully",
"data": {
"id": "document_encrypted_id",
"debt_id": "debt_encrypted_id",
"internal_id": "DEBT-2026-001",
"invoice_reference": "INV-2026-001",
"original_filename": "invoice.pdf",
"status": "active",
"match_method": "manual",
"created_at": "2026-07-04T10:30:00+00:00"
}
}
Errors
400- Missing file, invalid upload, non-PDF file, or file too large403- Missing scope or invoice documents feature is not enabled404- Debt not found or not accessible409- The debt already has an invoice document andreplace_manualwas not set