draft status. A draft does not yet have an invoice number (number is null), is not visible to your customer, and can be modified or deleted at any time. To make the invoice official and send it to the customer, call POST /api/v1/invoices/:id/finalize after creation.
Line items can be ad-hoc (supply description and unit_amount directly) or catalog-based (supply a price ID to inherit description, rate, and tax rate from a saved price).
https://invoice.horizonpay.co
Authentication
string
required
Bearer token in the form
Bearer inv_live_…. The token must carry the invoices:write scope.string
required
A unique key (UUID or any string up to 255 characters) you generate per logical create operation. If the request is retried with the same key, the original response is replayed and no second draft is created. The replayed response includes the header
Idempotent-Replayed: true.string
required
Must be
application/json.Body Parameters
string
required
The
cus_… public ID (or UUID) of an existing customer to attach to this invoice. The customer’s address and contact details are snapshotted onto the invoice when it is finalized.string
Three-letter ISO 4217 currency code (e.g.
"USD", "EUR", "INR"). Defaults to your account’s configured currency. All unit_amount values in items must be expressed in the minor units of this currency.string
How you intend to collect payment. One of
"send_invoice" (default) or "charge_automatically".string
ISO 8601 date the invoice is issued (
YYYY-MM-DD). Defaults to today if omitted.string
ISO 8601 date payment is due (
YYYY-MM-DD). Pass an empty string "" to clear a previously set date.integer
Convenience alternative to
due_date. Number of days from issue_date until payment is due (0–365). Ignored if due_date is also supplied.string
Notes displayed on the invoice body. Pass
null or omit to leave blank.Footer text shown at the bottom of the invoice, typically used for payment terms. Pass
null or omit to leave blank.array
One or more line items to add to the invoice. At least one line item is required. Each element is an object with the fields below.
Request Example
Response Example
HTTP201 Created
number is always null on a newly created invoice. An invoice number is permanently assigned only when you call POST /api/v1/invoices/:id/finalize. This means you can create and discard drafts without gaps in your invoice number series.Response Fields
string
Unique public identifier for the new invoice, prefixed
in_.string
Always
"invoice".null
Always
null for a newly created draft. Assigned on finalization.string
Always
"draft" on creation.string
The
cus_… public ID of the attached customer.string
Three-letter ISO 4217 currency code.
integer
Sum of all
line.amount values before tax, in minor units.integer
Total discount amount across all lines, in minor units.
integer
Taxable base amount (subtotal minus discount), in minor units.
integer
Total tax amount, in minor units.
integer
Grand total (taxable + tax), in minor units.
integer
Always
0 for a draft — no payment is owed until the invoice is finalized.object
Object containing a
data array of the invoice’s line items, each with its computed amounts.string
Unique identifier for the line item, prefixed
ii_.string
Always
"invoiceitem".string | null
The
price_… ID of the catalog price, or null for ad-hoc lines.string | null
The
prod_… ID of the parent product, or null for ad-hoc lines.integer
Price per unit in minor units.
integer
Line total (
quantity × unit_amount, after discount), in minor units.integer
Tax charged on this line, in minor units.