Invoices
An Invoice is a request for payment with its own hosted page. It is not a payment: when a Customer pays it, Transxact creates an ordinary Checkout Session, so fees, Payouts and webhooks work as they do for any other payment.
The Invoices API is for Business accounts. A key from any other account
gets 403 business_only.
The flow
POST /v1/invoicescreates a draft.POST /v1/invoices/{id}/sendgives it a number (INV-0007) and makes itsurlwork. Share that URL with your Customer.- The Customer opens
url, pays, and you hear about it by webhook.
A sent Invoice can’t be edited, because it may already be on the Customer’s phone. To change one, void it and make another.
Amounts are integers in FJD cents. The total, with tax, must be under FJD
5,000.00 (at most 499999), in Test mode and Live mode alike.
Idempotency
create, send and void require an Idempotency-Key. Retrying with the same
key returns the original result: no second draft, no second number, no second
void. A new key on an Invoice that has already moved on gets
409 invalid_state.
Modes
An Invoice belongs to the mode of the key that created it. A sk_test_ key
only sees Test mode Invoices and a sk_live_ key only Live mode ones; the
other mode’s Invoices read as 404.
Finding the Invoice a payment is for
The Checkout Session created when a Customer pays an Invoice carries
invoiceNumber, both in GET /v1/checkout-sessions/{id} and in the
checkout_session.* webhook payload. Sessions that don’t pay an Invoice omit
the field. There is no separate Invoice webhook event.
pdfUrl on a sent Invoice is where to GET its PDF, with your secret key. It
is the same file the Customer’s page and emails carry.