Credit Note Links
Link a credit note to the invoice it credits
Credential: a company's API key or OAuth token.
Applies the credit note to the invoice, recorded as a settlement between the two dated today. Both stop appearing as open for the amount applied. Works for a customer credit note against a sales invoice and a supplier credit note against a bill; the side is read off the credit note.
A credit note already applied to another invoice is released from it first, and that invoice opens again. Naming an invoice it is already on applies any credit it has left to that same invoice.
Refused when the two belong to different counterparties or currencies, when the invoice is settled,
when today’s accounting period is closed, and — unless confirmRateGap is true — when the two were
booked at exchange rates far apart.
Required Scope
journal-entries-write
Headers
x-api-idempotency-keyOptional idempotency key for safely retrying mutating requests.
Link a credit note to the invoice it credits › Request Body
creditNoteIdThe credit note: the id the open-entries listing reports for a row of type CREDIT_NOTE.
invoiceIdThe invoice (or supplier bill) it credits: the id the open-entries listing reports for a row of type INVOICE. Same counterparty and currency as the credit note.
confirmRateGapAccept that the two documents were booked at exchange rates further apart than the confirmation threshold. Without it such a pair is refused with CREDIT_NOTE_LINK_RATE_GAP_CONFIRMATION_REQUIRED, whose details carry both rates.
Link a credit note to the invoice it credits › Responses
The credit note’s link state after linking
creditNoteIdsidecurrencyISO 4217 currency of the credit note.
Every invoice the credit note is applied to, whether by a link or by a settlement pairing the two. Empty when it is applied to none.
unusedCreditAmountCredit not yet spoken for, as a positive magnitude in the note’s currency: what a further link to an invoice it is ALREADY on can absorb.
releasableCreditAmountThe unused credit plus what releasing its current applications would hand back, as a positive magnitude: what an invoice it is NOT yet on can absorb, since linking it there releases the others first.
Check a credit note’s links and the invoices it can be linked to
Credential: a company's API key or OAuth token.
Reports which invoices the credit note is applied to, how much credit it has left, and the open invoices of the same counterparty in the same currency it can be linked to. Nothing is changed.
Name invoiceId to learn whether that invoice is among the candidates. Send requireApplied: true
to be refused whatever an unlink would refuse.
Required Scope
journal-entries-write
Headers
x-api-idempotency-keyOptional idempotency key for safely retrying mutating requests.
Check a credit note’s links and the invoices it can be linked to › Request Body
creditNoteIdThe credit note: the id the open-entries listing reports for a row of type CREDIT_NOTE. A customer and a supplier credit note are both accepted; the side is read off the note.
invoiceIdThe invoice to check the credit note against: the id the open-entries listing reports for a row of type INVOICE. Named, the preview is refused whenever linking the two would be (another counterparty or currency, a settled invoice, today’s accounting period closed, a rate gap not accepted), and nothing is changed. Omit it to list the candidates only.
requireAppliedWhen true, refuse whatever unlinking the credit note would refuse: 409 CREDIT_NOTE_LINK_NOT_LINKED when it is applied to no invoice, a settlement holding it that also settled a payment, and today’s accounting period being closed.
confirmRateGapWith invoiceId, accept a gap between the two booked exchange rates, as the link call does. Without it, a pair booked at rates far apart is refused here as the link would refuse it.
Check a credit note’s links and the invoices it can be linked to › Responses
The credit note’s link state and candidates. Nothing was changed.
Open invoices of the same counterparty in the same currency the note can be linked to, closest amount first.
invoiceIsCandidateWhether invoiceId is among the candidates. Null when no invoice was named. A named invoice the credit note cannot be linked to refuses the preview itself, with the reason the link call would give.
Detach a credit note from the invoices it is applied to
Credential: a company's API key or OAuth token.
Releases every application of the credit note — a link, or a settlement pairing it with one invoice — so the note and each invoice it left are open again. A settlement that applied the note to an invoice is reversed, which posts today and is refused while today’s accounting period is closed.
Refused with 409 CREDIT_NOTE_LINK_NOT_LINKED when the note is applied to nothing, and refused when
a settlement holding it also settled a payment: undo that settlement instead.
Required Scope
journal-entries-write
Headers
x-api-idempotency-keyOptional idempotency key for safely retrying mutating requests.
Detach a credit note from the invoices it is applied to › Request Body
creditNoteIdThe credit note to detach from every invoice it is applied to.
Detach a credit note from the invoices it is applied to › Responses
The credit note’s link state after unlinking
creditNoteIdsidecurrencyISO 4217 currency of the credit note.
Every invoice the credit note is applied to, whether by a link or by a settlement pairing the two. Empty when it is applied to none.
unusedCreditAmountCredit not yet spoken for, as a positive magnitude in the note’s currency: what a further link to an invoice it is ALREADY on can absorb.
releasableCreditAmountThe unused credit plus what releasing its current applications would hand back, as a positive magnitude: what an invoice it is NOT yet on can absorb, since linking it there releases the others first.