Credit an invoice
Corrects a sent invoice with a numbered credit note: all of it, some of its lines or an amount, emailed like an invoice.
$0.10 a call
From your agent’s balance. A call that fails costs nothing.
An example
Hotel Elbblick sent two of the forty chairs back and we transferred the money. Credit them on their invoice.
Your agent callsinvoices_create_credit_note$0.10 a call
The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.
{
"invoice_id": "2d9c4e7b-1a3f-4c5d-8e6f-0b1a2c3d4e5f",
"lines": [
{
"line": 1,
"quantity": 2
}
],
"reason": "Returned: 2 bistro chairs, beech",
"refunded": true,
"method": "bank_transfer",
"reference": "Refund INV-0042"
}Use it when
Goods came back, a sent invoice was wrong, or the customer gets money off. In much of the EU a sent invoice is corrected this way, not voided.
- For a draft that was never sent, use
invoices_update.
What it does
Issue 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.
What comes back
credit_note: the credit note with its number, the invoice it corrects (number and date, as its PDF and page name it), lines, totals, page and PDF; invoice: the invoice with what is credited and what is still owed; refund: the refund recorded on the invoice when the money went back; emailed_to. Every reply also carries cost_usd and balance_usd.
Inputs
| Name | Type | What it is |
|---|---|---|
invoice_idRequired | string | The invoice_id invoices_create returned (quotes and credit notes have one too). Exactly 36 characters. |
lines | array of objects | 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). 1 to 200 items. |
lines[].lineRequired | integer | The invoice's line number, from 1, in the order invoices_get lists its items. At least 1. |
lines[].quantity | number or string | How many to credit. Default: all of the line not credited yet. Up to 24 characters. |
amount | number or string | 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). Up to 24 characters. |
reason | string | Printed on the credit note, e.g. "Returned: 1 bike rack". Up to 500 characters. |
refunded | boolean | true: the money went back to the customer (say how with method and reference). false: the credit lowers what they still owe. Default: false. |
method | string | With refunded: how the money went back. One of: bank_transfer,card,cash,check,online,other. Default: other. |
reference | string | With refunded: e.g. the bank transfer or refund id. Up to 120 characters. |
email | boolean | false: issue it without emailing anyone. Default: true. |
to | string | Email it to this address instead of the customer's. Up to 254 characters. |
message | string | A short note in the email. Up to 2,000 characters. |
link_hours | integer | How long the PDF download link works, in hours (up to 168). 1 to 168. Default: 24. |
The call
Over MCP, call invoices_create_credit_note on https://api.conecto.chat/mcp/invoices. Over REST:
curl -X POST https://api.conecto.chat/v1/tools/invoices_create_credit_note \
-H "Authorization: Bearer $CONECTO_KEY" \
-H "Content-Type: application/json" \
-d '{"invoice_id":"2d9c4e7b-1a3f-4c5d-8e6f-0b1a2c3d4e5f","lines":[{"line":1,"quantity":2}],"reason":"Returned: 2 bistro chairs, beech","refunded":true,"method":"bank_transfer","reference":"Refund INV-0042"}'When it refuses
A refused call costs nothing and says what to do next.
| Code | When | What to do |
|---|---|---|
not_found404 | No quote or invoice of the business has that invoice_id. | Find it with invoices_list and use its invoice_id. |
not_an_invoice400 | The id is a quote or a credit note. | Credit notes go against invoices. |
not_sent409 | The invoice is still a draft. | Change the draft with invoices_update instead. |
void409 | The invoice is void. | A void invoice owes nothing and takes no credit note. |
already_credited409 | A line named is credited in full already. | Credit other lines, or an amount. |
more_than_invoiced409 | The credit is more than what is left of the invoice, or of a line. | Credit at most what the message says is left. |
more_than_balance409 | The credit is more than what is still owed, and refunded is not true. | If the money went back to the customer, pass refunded: true. |
more_than_paid409 | refunded is true, but less than the credit was ever paid. | Credit at most what was paid, or leave refunded out to lower what is owed. |
nothing_to_credit409 | Everything on the invoice is credited already. | To charge the customer again, send a new invoice. |
invoice_incomplete409 | The invoice lacks what the law of the business's country needs on it: the business's address or VAT ID, the customer's VAT ID or address for a reverse charge, why a line has no tax. | Add what the message names (invoices_update, invoices_set_profile) and send again; nothing was numbered. |
national_system_required409 | The business is in a country whose domestic invoices must go through a national system (Italy, Poland, Belgium, Croatia, Romania, Hungary, Greece, Portugal; Spain from 2027, France from September 2027). | Send it through that system; invoices to customers abroad still work. |
vat_id_invalid409 | VIES says the customer's VAT ID is not valid, so the reverse-charge or intra-Community invoice can't go out. | Check the number with the customer and fix customer.tax_id with invoices_update. |
no_rate409 | The invoice is in another currency than the national one and its VAT must be shown in both, but there is no rate for the day. | Pass vat_exchange_rate with invoices_update (UK businesses always give it). |
invalid_input400 | A line, amount, date, currency, country, email or link is not valid, or the total comes out negative or too large. | Fix what the message names: amounts like 19.99, dates like 2026-11-20, currencies like EUR. |
no_email409 | The document has no customer email to send to. | Pass to, or set customer.email on the draft with invoices_update. |
payment_required_for_outbound402 | The balance is still free credit, which cannot email people outside the business. | Top up once (POST /v1/topups), or send with email: false and hand the link over yourself. |
suppressed422 | The address bounced, complained or unsubscribed before. | Send to another address with to. |
too_many_emails429 | This document was emailed as often as it may in 24 hours. | Try again tomorrow. |
daily_email_limit429 | The business emailed as many quotes and invoices in 24 hours as it may. | Try again tomorrow, or ask Conecto for more. |
email_failed502 | The email could not be sent; nothing was charged. | Call again in a moment. |
before_start409 | The date is before the books start. | Use a later date, or set an earlier start with books_setup. |
period_locked409 | The books are locked for that date. | Use a later date, or unlock the period with books_lock. |
no_role409 | The books have no account for a role the posting needs. | Give an account that role with books_save_accounts. |
More Invoices tools
All 24 tools- Set the business details
invoices_set_profileSets the business details on quotes and invoices: name, country, address, tax ID, logo, terms, tax, numbering, how to pay and legal notes.$0.001 a call - Get the business details
invoices_get_profileThe business details on quotes and invoices, the next numbers, and what is missing before documents can be sent.Free* - Connect Stripe for invoices
invoices_connect_stripeConnects the business's own Stripe account with a restricted key, so invoices can be paid online; the money goes straight to the business.$0.001 a call - Create a quote or invoice
invoices_createCreates a draft quote or invoice: the customer, the lines, the currency and the dates.$0.01 a call - Change a draft
invoices_updateChanges a draft quote or invoice; customer and lines replace the old ones.$0.01 a call - Send a quote or invoice
invoices_sendSends a draft: it gets the next number, its PDF is made, and the customer is emailed a link to view, pay or accept it.$0.10 a call - Get a quote or invoice
invoices_getOne quote or invoice in full, by invoice_id or number: lines, totals, taxes, payments, history, its page and a fresh PDF link.Free* - List quotes and invoices
invoices_listQuotes and invoices, newest first, by kind, status (also overdue, unpaid and expired), customer and issue date.Free*
Give this to your agent.
Set up Conecto from https://conecto.chat/SKILL.md