POST
Upload Mapped Invoice Document

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 API
  • invoice_reference: invoice reference stored on the debt
  • internal_id: your internal debt ID
Use 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 the invoice_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-data
file
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

Success Response

Errors

  • 400 - Missing file, invalid upload, non-PDF file, or file too large
  • 403 - Missing scope or invoice documents feature is not enabled
  • 404 - No matching accessible debt was found
  • 409 - The debt already has an invoice document and replace_manual was not set