Create credit note
Credit all or part of an invoice with a refundable or adjustment credit note.
MCP tool chargebee_write → create_credit_note
Creates a credit note on an invoice and returns it with the updated invoice. The invoice status decides the type: a paid invoice takes only refundable, a payment_due or not_paid invoice only adjustment, a partially paid one either. Pass total or line_items, not both; amounts are in the smallest currency unit, so 5000 is $50.00. A refundable credit note starts with refund due and moves no money until someone refunds it. The comment stays inside Chargebee; customer_notes print on the credit note PDF. This changes what a customer owes or is owed, so by default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| reference_invoice_id string required | string | Invoice to credit, from list_invoices. |
| type enum required | enum | refundable or adjustment, as the invoice status allows. |
| total integer | integer | Credit amount in the smallest currency unit. Use this or line_items. |
| line_items array | array | Invoice lines to credit, with an amount each. Use this or total. |
| reason_code string | string | A reason code configured in Chargebee, case-sensitive. Required if your site makes reason codes mandatory. |
| comment string | string | Internal note, 300 characters at most. Not shown to the customer. |
| customer_notes string | string | Text printed on the credit note PDF, 2000 characters at most. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "chargebee_write",
"arguments": {
"operation": "create_credit_note",
"arguments": {
"reference_invoice_id": "INV-1042",
"type": "refundable",
"total": 5000,
"comment": "Support ticket 4412"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"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
}
},
"isError": false
}