# Vendor credits

> A credit note from a supplier is a vendor credit: received over Peppol it becomes one on its own, linked to the bill it corrects; it posts as the mirror of a bill with the VAT boxes negated, is applied to the supplier's open bills from the bill page, and the application can be removed. A debit memo entered by hand is a vendor credit too.

Source: /help/en/bills/vendor-credits

A **vendor credit** is a supplier's credit note (document type 381): the supplier owes you money back, usually against one bill (returned goods, an overcharge, a price correction). In Alya Books it is the same record a [bill](/help/en/bills/record-and-approve-a-bill) is, with the sign turned round: it reduces what you owe the supplier and what you reclaim as input VAT, and it is **applied** to open bills so the amount due on them falls, like a payment that moves no money.

## A received credit note becomes a vendor credit

Nothing to record. A credit note that arrives over Peppol, by e-mail or by upload is a vendor credit as soon as it is received:

1. **Linked to the bill it corrects.** The supplier's credit note names the invoice it corrects (the preceding invoice reference, BT-25). On import that reference is matched against the supplier's bills (same supplier contact, else the same TRN) and the link is kept on the credit (`vendorCreditOfId`). A reference that names none of the supplier's bills leaves the credit unlinked; it still posts and applies. The link is resolved again when the reference or the supplier changes and when the credit is accepted.
2. **Review and accept** it as you accept a received invoice. A credit asks no approver: the [approval workflow](/help/en/bills/record-and-approve-a-bill) gates payments of bills, and a credit is not paid.
3. **It posts as the mirror of a bill.** With the [ledger](/help/en/accounting/enable-the-ledger) enabled, accepting the credit books, in the purchases journal, the cost accounts and the input VAT on the **credit** side and the supplier's payable on the **debit** side (an open item the supplier owes you), with every VAT box negated: a standard-rated credit of 200 plus 10 VAT shows as −200 and −10 in box 9. The reverse charge, zero-rated, exempt and import rules of the country pack have their own vendor-credit rows (document kind `vendor_credit`), so box 10 and box 3 fall the same way.
4. **The VAT return reads it negative.** The purchase boxes of the VAT 201 worksheet, the parity audit and the payable control all count a vendor credit with a minus sign.

The **Vendor credits** tab of **Incoming Invoices** lists every credit note, received or recorded here, with its origin, its ledger state and whether it is voided.

## Return goods to a vendor

When the goods themselves go back, record a **purchase return** instead of typing the credit: on the accepted bill choose **More** → **Return goods**, pick the lines and quantities, confirm, and mark it **fulfilled** when the goods leave. The stock leaves the register at the current cost and the vendor credit is recorded for you at the bill's price and VAT, numbered like the return, with the VAT correction negated in the purchase box and the cost difference booked to inventory adjustments. Void the return and the credit is voided with it. The walkthrough is under [Stock valuation and purchase returns](/help/en/products/stock-valuation-and-purchase-returns).

## Apply a credit to a bill

On the bill page, the **Vendor credits** card shows the open balance of the bill, how many open credit notes of this supplier can settle it (same supplier, same currency, posted and not fully applied), and the applications already made.

1. **Apply credit.** Choose the credit note (the one issued against this bill is proposed first), the amount (at most what the credit has left and what the bill still owes) and the application date.
2. **What happens.** The amount due on the bill falls like a payment; its paid amount and payment status follow, and a [batch payment](/help/en/bills/pay-bills-in-a-batch) or a single payment pays the remainder. With the ledger enabled the application books a transfer within the payable account in the general journal: a debit settling the bill's open item under the bill's entry number and a credit settling the credit's open debit under the credit's entry number. A foreign-currency bill and credit are settled at their own rates and the difference is an exchange gain or loss.
3. **Remove the application.** The trash icon on the application removes it: the row is deleted and its ledger entry is reversed, never edited; the bill and the credit are open again. An application inside a locked period is refused (`period_locked`).

On the credit's own page the card shows the bill it corrects, its open balance and the bills it is applied to.

Refusals: `vendor_credit_not_open` (a draft or voided credit), `contact_mismatch` (another supplier), `currency_mismatch`, `amount_exceeds_open` (more than the bill or the credit has open), `bill_awaiting_approval` and `bill_voided` as for a payment.

## Refund a vendor credit balance

When the supplier pays the balance of a credit note back instead of leaving it to settle a later bill, record the money on the credit itself: on the credit's page the **Vendor credit** card shows **Refund AED …** for what is still open.

1. **Refund.** Enter the amount (the whole balance by default), the date, the method, the bank account the money came into and a reference. The refund is recorded as a payment on the credit, so the credit's balance falls and the card lists it as *Refund received* with the bank account.
2. **What the ledger books.** Dr the bank account (less a fee, which goes to bank charges) and Cr the payable, settling the credit's open line under the credit's entry number; a foreign-currency credit is settled at its own rate and the difference is an exchange gain or loss. A refund of more than the balance leaves the rest as a credit the supplier is owed again, listed under Open Items.
3. **Remove or change it.** The trash icon removes the refund: its entry is reversed and the credit is open again. The pencil on a supplier payment or refund row of a bill's Payments card changes its date, reference, bank account or amount in place (see [Pay bills](/help/en/bills/pay-bills-and-remittance-advice)).

A refund received on a **bill** (money back after an overpayment) stays a negative payment on the bill; `refund_supplier_credit` on a bill answers `invalid_vendor_credit`. The audit log records *vendor_credit.refunded*.

## Record a debit memo by hand

A credit the supplier gave you without a document, or a debit memo you issue to the supplier, is a vendor credit with origin **Recorded here**: on the Vendor credits tab choose **New vendor credit**, pick the bill it is against (the supplier, the reference and the currency are taken from it) or the supplier alone, and enter the credited lines as **positive** amounts with their cost account and VAT. **Save and accept** posts it at once; it is then applied from the bill page like a received credit note. A bill with a minus sign is still refused (`negative_bill`), and a 381 through the bill editor or `POST /bills` answers `vendor_credit_required`.

## Void and delete

A vendor credit follows the bill rules: a draft is deleted or rejected; an accepted credit is **voided** with a reason (its entry is reversed, the row stays with who, when and why, it leaves the VAT return and the payable). A credit that is applied is not voided (`vendor_credit_applied`): remove the application first. A voided credit cannot be applied.

## API and MCP

- `POST /vendor-credits` records a credit by hand (the same body as `POST /bills` with `billId` or `precedingInvoiceRef`); `GET /bills/{id}/credits` lists what can be applied and what is applied (on a credit, the refunds received too, with `refundedTotal`); `POST /bills/{id}/credits { creditId, amount, date }` applies; `POST /vendor-credits/{id}/refunds { amount, date, bankAccountId, method, reference, feeAmount, exchangeRate }` records a refund received; `PATCH /bills/{id}/payments/{paymentId}` changes a payment or refund in place; `DELETE /bills/{id}/payments/{paymentId}` removes an application, a payment or a refund. A received credit note is read through `/import/incoming/{id}` like any received document, with `vendorCreditOfId` set.
- MCP: `create_vendor_credit`, `list_bill_credits`, `apply_vendor_credit`, `refund_supplier_credit`, `update_bill_payment`, `delete_bill_payment`.

The audit log records `vendor_credit.created`, `bill.credit_applied` and `vendor_credit.voided`.
