Credit an invoice
invoices_create_credit_noteIssue a credit note against a sent invoice: all of it, some of its lines, or an amount. It takes the next credit note number (gapless, CN-0001...), gets a PDF and a page like an invoice, and is emailed to the customer unless email is false. It lowers what the customer still owes; refunded: true says the money went back to them instead, and the invoice records the refund. In much of the EU a sent invoice is corrected this way, not voided. When the account keeps books, the sale and its tax are reversed there. Costs $0.10 per call; nothing if it fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Email it to this address instead of the customer's. | |
| No | false: issue it without emailing anyone. | ||
| lines | No | Lines of the invoice to credit, at its prices. Leave out lines and amount to credit the whole invoice (or what is left of it). | |
| amount | No | A sum to credit, tax included, e.g. "50.00" off for a late delivery. Its tax follows the invoice's rates (or those of `lines`, when given too). | |
| method | No | With refunded: how the money went back. | other |
| reason | No | Printed on the credit note, e.g. "Returned: 1 bike rack". | |
| message | No | A short note in the email. | |
| refunded | No | true: the money went back to the customer (say how with method and reference). false: the credit lowers what they still owe. | |
| reference | No | With refunded: e.g. the bank transfer or refund id. | |
| invoice_id | Yes | The invoice_id invoices_create returned (quotes and credit notes have one too). | |
| link_hours | No | How long the PDF download link works, in hours (up to 168). |