Skip to main content
Transitions a draft invoice to open status. Finalization does three things atomically:
  1. Assigns a permanent invoice number from your configured number series (e.g. INV/25-26/0042). Invoice numbers are consecutive and can never be reused or skipped — an auditor seeing a gap reads it as a hidden transaction.
  2. Freezes the business and customer snapshots — the name, address, and tax ID of both parties as they appear on the PDF are locked at this moment. Future edits to your business profile or the customer record do not alter the document.
  3. Sets status to open and assigns finalized_at. The invoice is now visible to the customer via its public URL token.
Once finalized, an invoice cannot be edited or deleted. To cancel it, use POST /api/v1/invoices/:id/void.
Base URL: https://invoice.horizonpay.co

Authentication

string
required
Bearer token in the form Bearer inv_live_…. The token must carry the invoices:finalize scope.
string
required
A unique key (UUID or any string up to 255 characters) you generate per logical finalize operation. This endpoint requires the header — the request is rejected with 428 if it is absent.

Path Parameters

string
required
The invoice’s public ID (in_…) or its UUID. The invoice must currently be in draft status.

Request Body

This endpoint does not accept a request body.

Request Example


Response Example

Idempotency-Key is required on this endpoint. Finalization spends an invoice number from a consecutive series. A network timeout after the server commits but before the response arrives leaves you uncertain whether the number was assigned. Without a key, a retry runs the handler again, potentially burning a second number and creating a gap in the series that auditors will flag. Always generate a fresh UUID per finalize operation and retain it for retries.If a replay occurs, the response header Idempotent-Replayed: true is present, and the body is identical to the original successful response — including the invoice number that was assigned.
The server guarantees that even if two requests are sent simultaneously without an Idempotency-Key, only one invoice number is ever assigned — the second concurrent request will find the invoice already finalized and return its existing number. The key is still required to protect against the case where the caller cannot detect this race.
After finalization, amount_due changes from 0 to the invoice total. The public_url_token is also populated on finalization, enabling the shareable customer-facing link.

Response Fields

string
Unique public identifier for the invoice, prefixed in_.
string
Always "invoice".
string
The newly assigned, permanent invoice number (e.g. "INV/25-26/0042"). Never null after a successful finalization.
string
"open" immediately after finalization, unless due_date is already in the past, in which case subsequent reads return "overdue".
integer
Now equals total — the full amount is owed.
string
Populated on finalization. Use this token to construct the shareable PDF link for your customer.
string
ISO 8601 datetime when the invoice was finalized.
object
The frozen set of line items. These cannot be changed after finalization.
For all other fields, see the Retrieve Invoice response fields.

Error Codes