Upload Mapped Invoice Document
curl --request POST \
--url https://getbill.io/external-api/v1/invoice-documents \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"debt_id": "<string>",
"invoice_reference": "<string>",
"internal_id": "<string>",
"replace_manual": true
}
'import requests
url = "https://getbill.io/external-api/v1/invoice-documents"
payload = {
"debt_id": "<string>",
"invoice_reference": "<string>",
"internal_id": "<string>",
"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({
debt_id: '<string>',
invoice_reference: '<string>',
internal_id: '<string>',
replace_manual: true
})
};
fetch('https://getbill.io/external-api/v1/invoice-documents', 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/invoice-documents",
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([
'debt_id' => '<string>',
'invoice_reference' => '<string>',
'internal_id' => '<string>',
'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/invoice-documents"
payload := strings.NewReader("{\n \"debt_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"internal_id\": \"<string>\",\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/invoice-documents")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"debt_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"replace_manual\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/invoice-documents")
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 \"debt_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"internal_id\": \"<string>\",\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 Mapped Invoice Document
Upload a PDF invoice document and map it to a debt
POST
/
external-api
/
v1
/
invoice-documents
Upload Mapped Invoice Document
curl --request POST \
--url https://getbill.io/external-api/v1/invoice-documents \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"debt_id": "<string>",
"invoice_reference": "<string>",
"internal_id": "<string>",
"replace_manual": true
}
'import requests
url = "https://getbill.io/external-api/v1/invoice-documents"
payload = {
"debt_id": "<string>",
"invoice_reference": "<string>",
"internal_id": "<string>",
"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({
debt_id: '<string>',
invoice_reference: '<string>',
internal_id: '<string>',
replace_manual: true
})
};
fetch('https://getbill.io/external-api/v1/invoice-documents', 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/invoice-documents",
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([
'debt_id' => '<string>',
'invoice_reference' => '<string>',
'internal_id' => '<string>',
'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/invoice-documents"
payload := strings.NewReader("{\n \"debt_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"internal_id\": \"<string>\",\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/invoice-documents")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"debt_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"internal_id\": \"<string>\",\n \"replace_manual\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/invoice-documents")
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 \"debt_id\": \"<string>\",\n \"invoice_reference\": \"<string>\",\n \"internal_id\": \"<string>\",\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 separately from debt creation. GetBill maps the document to one existing debt using one of these identifiers:debt_id: stable encrypted debt ID from the Debts APIinvoice_reference: invoice reference stored on the debtinternal_id: your internal debt ID
debt_id when possible. invoice_reference and internal_id are useful when your billing system exports documents separately from the debt creation flow.
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-datafile
required
PDF invoice file. Maximum size: 25 MB.
string
Stable encrypted debt ID returned by the Debts API.
string
Invoice reference stored on the debt. Used only when
debt_id is not provided. The value must match exactly one debt.string
Internal debt ID stored on the debt. Used only when
debt_id and invoice_reference are not provided. The value must match exactly one debt.boolean
Set to
true to replace an existing manually uploaded invoice document. Default: false.Example Request
curl
curl -X POST "/external-api/v1/invoice-documents" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "invoice=@./invoice.pdf;type=application/pdf" \
-F "invoice_reference=INV-2026-001"
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- No matching accessible debt was found409- The debt already has an invoice document andreplace_manualwas not set