Skip to navigation

PayInvoice

View as Markdown

Used to issue a payment against an invoice.

Input variables

  • invoiceId: id of the invoice (path variable)

  • json representation of a payment object

    • amount (decimal)

    • privateNotes (if any)

    • publicNotes (if any)

    • paymentmethod: the id of a payment method. The defaults are 1 Cash, 2 Bank Transfer, 3 Online, 4 Check, but methods are configured per school - call GetPaymentMethods for the list that applies to yours.

    • createdAt (optional)

A payment recorded here is always settled

This endpoint records money the school already has in hand, so the payment is created with status 1 (VALID) and counts towards the invoice’s paidAmount immediately.

status, paymentFees and stripePaymentIntentId are read-only and ignored if sent - they describe what a payment provider did, and this endpoint takes no payment. Card and bank payments reach the invoice through Stripe instead, and those are the ones that can appear with status 2 (failed) or 3 (still clearing).

The response is the updated invoice, whose payments array carries these fields for every payment on it.

Path parameters

invoiceIdstringRequired

Headers

dreamclass-secret-keystringOptional

Your DreamClass API key. Required on every request. Find it in the DreamClass app under Settings > Integrations.

tenantstringOptional

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.

schoolCodestringOptional

Your school code. Required on every request. Find it in the DreamClass app under Settings > Integrations.

Request

This endpoint expects an object.
amountdoubleRequired
publicNotesstringRequired
paymentmethodobjectRequired
createdAtdatetimeRequired
privateNotesanyOptional

Response

OK
idinteger
invoiceRefIdstring
amountdouble
paidAmountdouble
statusinteger
fullnamestring
addressstring
telephonestring
emailstringformat: "email"
createdAtdatetime
issueDatedate
dueDatedate
publicNotesstring
feeslist of objects
paymentslist of objects
studentIdslist of integers
privateNotesanyOptional