Create an Invoice
Creates a draft Invoice in the key’s mode. It has no number and no working url until you send it. The total, with tax, must be under FJD 5,000.00 (at most 499999 cents), in Test mode and Live mode alike. The Idempotency-Key header is required: a retry with the same key returns the original draft instead of making a second.
Authentication
Your secret key: sk_test_… in Test mode, sk_live_… in Live mode.
Headers
Client-generated key; a repeated key returns the original result instead of repeating the change.
Request
YYYY-MM-DD, Pacific/Fiji.
Label for the one optional tax line, such as VAT. Needs taxPercent.
Response
Draft created, or replayed from the Idempotency-Key.
The Invoice number, such as INV-0007. Assigned when the Invoice is sent, so a draft has none; numbers are never reused.
draft until sent and editable only from the dashboard. sent: the Customer can pay it. paid: paid in full. void: you voided it; it can no longer be paid.
A sent, unpaid Invoice past its due date (Pacific/Fiji). Derived, not a status; the Customer can still pay.
test for an Invoice made with an sk_test_ key, live for an sk_live_ key.
Label of the tax line; null if none.
YYYY-MM-DD, Pacific/Fiji.
Sum of the line items, in FJD cents (minor units).
The tax line, in FJD cents (minor units).
Amount due; under FJD 5,000.00, in FJD cents (minor units).
Where to GET the PDF, with your secret key. Null on a draft.
Unix ms timestamp it was sent; null on a draft.
Unix ms timestamp it was paid; null until then.