GetInvoice
Get details of a single invoice
Input variables
- invoiceId: number of the invoice
Students on an invoice
- studentIds — every student the invoice bills, each listed once. An invoice made out to a guardian can bill several children, so this is always a list.
- fees[].studentId — the student a fee line bills. Use it with GetStudent.
- fees[].periodStudentId — the student’s enrollment in the school period the line bills for. It is the same id as
idin GetPeriodStudents andschoolPeriods[].idin GetStudent and GetStudents. - fees[].schoolPeriodId — the school period the line bills for. Together with
periodStudentIdit fetches just that enrollment:GET /students/schoolperiod/{schoolPeriodId}/list?periodStudentId={periodStudentId}.
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 collectsamount + paymentFeesas 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.
Path parameters
Headers
Your DreamClass API key. Required on every request. Find it in the DreamClass app under Settings > Integrations.
Your tenant code: the DreamClass subdomain you sign in at (for https://myaccount.dreamclass.io it is “myaccount”), or your full white-labelled domain. Required on every request.
Your school code. Required on every request. Find it in the DreamClass app under Settings > Integrations.
