Get details of a single invoice
Input variables
- invoiceId: number of the invoice
Payment object fields
- status — whether the payment settled. 1 VALID (settled), 2 INVALID (failed), 3 PENDING (in flight), 4 REFUNDED. May be absent on payments predating the field; treat absent as settled.
- paymentFees — the online processing fee taken on top of
amount, which never includes it. Stripe collects amount + paymentFees as a single charge, so this is what reconciles a payment against a Stripe payout.
- stripePaymentIntentId — the Stripe PaymentIntent behind the payment, or null for a manually recorded one.
All three are read-only: they report what the payment provider did and are never accepted in a request body.
Reconciling payments against paidAmount
An invoice’s payments are every attempt made against it, not only the money it received. A declined card records a payment row of its own, so the array can total more than paidAmount. Only status 1 rows move paidAmount, and only those sum to it.
status 3 is not a failure: bank debits (ACH) sit there for 3-5 business days while they clear. Count 1 as received, exclude 2, and report 3 separately as pending receipts.
A retried card charge is billed for the invoice’s remaining balance, so repeated attempts carry identical amounts. The amount alone cannot separate a failed retry from a genuine instalment — use status.
The example response below shows this: two settled payments of 5.25 summing to paidAmount 10.50, alongside a declined 10.50 card attempt that does not.