Recording a payment received
For money that arrived outside the app: a bank transfer, cash, a cheque. The app hands the payment to WHMCS through its own AddInvoicePayment call rather than writing to the ledger itself, so WHMCS decides whether the invoice is now settled, applies any surplus as client credit, fires its hooks and sends the receipt. That matters: writing the rows directly would produce an invoice that looks paid on one screen and unpaid on another. There is no undo inside the app. A payment entered by mistake has to be removed from the invoice in the WHMCS admin area, which is deliberate, because reversing money should be a considered act rather than a stray tap on a phone.