Chargebee automation · runs weekly
Issue Chargebee credit notes for refunds and billing mistakes
A customer was double charged, or a service credit was promised in a support thread, and someone opens the invoice in Chargebee to work out which credit note type the invoice status allows.
Cotlet does it in your own Chargebee account with get_invoice, list_credit_notes and create_credit_note, called by your AI agent, an n8n workflow or a script.
Hosted · nothing to install or maintain
Can Chargebee do this on its own?
Chargebee's REST API creates credit notes with POST /credit_notes, and the console offers Create a Credit Note on every invoice (checked 14 Oct 2026). The ready-made MCP servers do not create credit notes. The one gap is who does the clicking: someone has to open each invoice, because credits issued by hand are not driven by your ticket or a rule.
How you do it in Chargebee today
- Open the invoice from the Invoices list or the customer profile.
- Click Create a Credit Note.
- Pick the type the invoice status allows: Adjustment on a Payment Due or Not Paid invoice, Refundable on a Paid invoice, either on a partially paid one.
- Set the amount, or select individual line items for a partial credit, and choose a reason that will appear on the credit note.
- To send money back, open the credit note afterwards, click Issue a refund, enter the amount and click Refund. Refunds to the original payment method work for card payments only.
How to issue Chargebee credit notes for refunds and billing mistakes
Issue a $50.00 refundable credit note on invoice INV-1042 for the outage last week, with the internal comment "Support ticket 4412". Show me the credit note before you send anything to the customer. - 01
Read the invoice before crediting it
Your agent loads the invoice and checks its status and amounts. The status decides the credit note type: a Paid invoice can only get a refundable one, a Payment Due or Not Paid invoice only an adjustment.
- 02
Check for an earlier credit
It lists the credit notes already on that invoice and compares them with your request. If a $50.00 credit already exists with the same comment, it stops, so a retried ticket does not pay out twice.
- 03
Keep the credit within the invoice
A request larger than the invoice total, or larger than what is left after earlier credit notes, is not sent. The agent reports the limit and asks for a smaller amount.
- 04
Write the two notes
The internal comment stays inside Chargebee. customer_notes appear on the credit note PDF, so the agent leaves them empty unless your prompt gives wording for the customer.
- 05
Create it after your OK
create_credit_note issues the credit, and the agent reports the credit note ID, type and status so you can follow up with a refund if one is due.
What you get back
Created credit note CN-319 on INV-1042
Type: refundable, $50.00, status: refund due
Invoice total $299.00, paid
Internal comment: Support ticket 4412
No refund issued yet Other ways to ask
- Credit $20.00 as an adjustment on every Payment Due invoice of customer cus_9s2kQw and list what you created.
- Check whether invoice INV-1038 already has a credit note, and if not, credit the full $99.00 as refundable.
- Draft the credit note for each ticket tagged "double charge" and wait for my OK on the whole list.
What Chargebee allows, and what to know first
- A Chargebee refundable credit note applies to paid invoices and can stay on the account for future invoices or be refunded, while an adjustment reduces an unpaid invoice and is not refundable.
- The create endpoint takes either a total or line_items, not both, and amounts are in the smallest currency unit, so $50.00 is 5000.
- A reason code must match a code configured in Chargebee and is required if your site makes reason codes mandatory; the internal comment is limited to 300 characters.
- A standalone refundable credit, not tied to any invoice, needs Chargebee Support to enable it first.
- A credit note with refund due is not a refund: the money moves only when someone clicks Issue a refund, and refunds to the original payment method work for card payments only.
create_credit_note asks for your OK by default. To run it weekly without you, switch confirmation off for that tool in your dashboard.
Sources: Chargebee Docs: Credit Notes · Chargebee Docs: Invoice Operations · Chargebee API: Create credit note
Call create_credit_note from a script
curl -X POST https://cotlet.dev/api/v1/chargebee/reference-invoices/INV-1042/credit-notes \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"refundable","total":5000,"comment":"Support ticket 4412"}' {
"credit_note": {
"credit_note_id": "CN-319",
"reference_invoice_id": "INV-1042",
"type": "refundable",
"status": "refund_due",
"total": 5000,
"currency_code": "USD",
"comment": "Support ticket 4412"
},
"invoice": {
"invoice_id": "INV-1042",
"status": "paid",
"total": 29900,
"amount_paid": 29900,
"amount_due": 0
}
} MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is chargebee_write → create_credit_note. Example data.
Schedule it in n8n, Make, Zapier or cronChargebee tools this automation uses
| Tool | Parameters |
|---|---|
| get_invoice | invoice_id |
| list_credit_notes | customer_id, invoice_id, type, limit, cursor |
| create_credit_note | reference_invoice_id, type, total, line_items, reason_code, comment, customer_notes |
Frequently asked questions
Is it safe to connect Chargebee to Cotlet?
Yes. You sign in to Chargebee yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Chargebee once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.
Give your agent access to Chargebee.
Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with Chargebee.