Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

An Invoice-AI API key sent as Authorization: Bearer inv_live_….

Create keys in Settings → API keys; the secret is shown once. Each key carries scopes, and every operation lists the scope it needs (x-required-scope):

  • business:read — Read your business profile, tax ID and bank details
  • clients:read — List and read your clients
  • clients:write — Create, update and archive clients
  • products:read — List and read products and prices
  • products:write — Create, update and archive products and prices
  • invoices:read — List and read invoices, including PDFs
  • invoices:write — Create, edit and delete drafts
  • invoices:finalize — Finalize invoices and void them
  • invoices:send — Email invoices to your clients
  • payments:write — Mark invoices as paid
  • webhooks:manage — Manage webhook endpoints

Keys cannot be created or revoked through the API, so a leaked key cannot mint more keys.

Headers

Idempotency-Key
string
required

A unique key per distinct operation (a UUID works), reused only when retrying that same request. Up to 255 characters; stored for 24 hours.

Maximum string length: 255
Example:

"6f1c2d9e-8a4b-4c3f-9e7d-2b5a1c8f4e30"

Body

application/json

Either price, or description + unit_amount.

invoice
string
required

The draft to append to, in_… or UUID.

Minimum string length: 1
Example:

"in_Pb2Xk7Mv4Qs9Lr1Wd6Tn3Fh8"

price
string

A catalog price, price_… or UUID. Its product name, unit amount and tax rate fill any of description, unit_amount, tax_rate you omit. Its currency must match the invoice.

Example:

"price_Jc5Tn8Wq1Ze6Ra3Ym9Ub2Gs7"

description
string
default:""

What you are billing for. Required unless price is given.

Example:

"Onboarding workshop"

quantity
number
default:1

Quantity, greater than zero. Defaults to 1.

Example:

1

unit
enum<string>
default:NOS

Unit of measure. Defaults to NOS (numbers).

Available options:
NOS,
PCS,
KGS,
GMS,
LTR,
MTR,
SQF,
SQM,
HRS,
DAY,
MON,
BOX,
SET,
OTH
Example:

"NOS"

unit_amount
integer

Price per unit in integer minor units of the invoice currency. Required unless price is given.

Required range: 0 <= x <= 9007199254740991
Example:

50000

discount_percent
number
default:0

Discount percentage, 0–100, applied before tax. Defaults to 0.

Required range: 0 <= x <= 100
Example:

0

tax_rate
number

Tax percentage, 0–100, added on top. Defaults to the price’s rate, or 0 on ad-hoc lines.

Required range: 0 <= x <= 100
Example:

0

Response

The whole draft, with the new line last.

data
object
required

The updated draft.