Alya Books

    Help centre

    Guides for Alya Books and UAE e-invoicing

    Apply credits and refunds

    Settle an open invoice with a credit note, an overpayment or an open journal credit of the same customer, remove the application again, pay a credit note balance or an overpayment back to the customer, and change a payment or refund after the fact.

    A credit note corrects an issued invoice; an overpayment leaves the customer with money on account. Neither reduces what another invoice shows as due until it is applied to it, and neither reaches the bank until it is refunded. Both need the ledger enabled, because they are matched against the receivable lines of the documents.

    Apply a credit to an invoice

    1. Open the invoice with an open balance and scroll to the Payments card. When the customer has an open credit note, overpayment or journal credit in the invoice currency, the card shows Apply credit (n).
    2. Pick the credit note, the overpayment or the journal credit. A journal credit is a credit line of the customer on the receivable account that no document booked: a deposit entered as a manual journal, or a customer balance brought in with the opening balance. It is listed by its entry number with the line's description. The amount is pre-filled with the most that can be applied: what the credit has open and what the invoice still needs. Lower it for a part application.
    3. Click Apply credit. The invoice's amount due falls like a payment and its status moves to Partially paid or Paid; the row appears in the Payments list as Credit note applied, Overpayment applied or Journal credit applied.

    In the books, an application moves the amount within the receivable account and matches both lines: the credit's line under the credit entry's number, the invoice's line under the invoice entry's number. No VAT box is touched: the VAT return still shows the original invoice and credit note. Applying a credit note to the very invoice it corrects is the usual case; applying it to a different open invoice of the same customer works the same way (contact_mismatch and currency_mismatch refuse other customers and currencies, amount_exceeds_open more than is open on either side).

    Both documents must be posted first (document_not_posted); with automatic posting on they are.

    Remove an application

    Click the bin icon on the row in the Payments list. The invoice is open again for that amount, the credit is available again, and the ledger entry of the application is reversed, never deleted. Open items per customer are under Accounting → Open Items.

    Refund the customer

    Money goes back to the customer in two cases, both from the Payments card:

    • an overpaid invoice shows Refund AED … for the excess;
    • a credit note with a balance not applied anywhere shows Refund AED … for what is still owed.

    Enter the amount (the full credit by default), the date, the method, the bank account the money leaves, and a reference. The refund is recorded as a payment row: a negative payment on an invoice, a positive one on a credit note, so the payment status of the document follows. The ledger credits the bank account and settles the open credit under the credit's entry number; for a foreign-currency document the difference between the credit's booked rate and the rate of the refund date books to realised exchange gain or loss. A refund of more than the customer has in credit leaves the rest as a balance they owe, listed under Open Items.

    A refund can be removed like any payment: its entry is reversed and the credit is open again. A payment whose overpayment was refunded cannot be removed before the refund (payment_in_use).

    Change a payment or refund

    A wrong date, reference, bank account or amount on a payment or a refund is corrected in place: the pencil on the row in the Payments card opens Edit payment (or Edit refund) with the row's values. The row keeps its id and its place in the list. With the ledger enabled, a new amount, date, bank account, fee or exchange rate reverses the entry and books a new one on the new date; a new reference or note keeps the entry. A payment stays a payment and a refund a refund: to turn one into the other, remove the row and record it again. A credit application, an overpayment application or a write-off is never edited (payment_not_editable): remove it and apply it again. The audit log records payment.updated or refund.updated with each field's before and after.

    In the API and the MCP server

    • GET /invoices/{id}/credits lists the credits that can be applied and those applied (kind credit_note, overpayment or journal_credit); POST /invoices/{id}/credits applies one (creditNoteId, paymentId or ledgerLineId, optional amount and date).
    • POST /invoices/{id}/refunds records a refund (amount, date, bankAccountId, method, reference, exchangeRate).
    • PATCH /invoices/{id}/payments/{paymentId} changes a payment or refund in place (date, reference, note, bankAccountId, amount, method, feeAmount, exchangeRate; send only what changes); the answer lists changed as before and after per field.
    • DELETE /invoices/{id}/payments/{paymentId} removes an application or a refund.
    • MCP: list_invoice_credits, apply_credit_to_invoice (with ledgerLineId for a journal credit), refund_customer, update_invoice_payment, delete_invoice_payment.

    Related:

    Still stuck? Contact support