Refund invoice
Refund a line item or the whole invoice by quantity, amount or percentage.
MCP tool recurly_write → refund_invoice
Refunds part or all of one invoice and creates a refund credit invoice with credit line items against the paid charges. Methods: quantity on a line item, a specific amount, or a percentage. Amount and percentage refunds on a line item need the Only Bill What Changed and Credit Memos features on your site. The money goes back as account credit by default; refund_apply_order transaction sends it to the payment method first. It moves money to the customer. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| invoice_number string required | string | Invoice number from list_invoices. |
| method enum required | enum | quantity, amount or percentage. |
| line_item_id string | string | Line item from get_invoice. Omit to refund the entire invoice (amount or percentage only). |
| quantity integer | integer | Units to refund. Required for method quantity. |
| amount_in_cents integer | integer | Amount to refund. Required for method amount. |
| percentage integer | integer | Percentage to refund. Required for method percentage. |
| prorate boolean | boolean | Prorate the refunded line item. Default: false. |
| refund_apply_order enum | enum | credit or transaction. Default: credit. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "recurly_write",
"arguments": {
"operation": "refund_invoice",
"arguments": {
"invoice_number": "1042",
"method": "quantity",
"line_item_id": "3dc1a8f09b4c4e55a1e0",
"quantity": 1,
"refund_apply_order": "credit"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"refund_invoice_number": "1105",
"original_invoice_number": "1042",
"state": "collected",
"subtotal_in_cents": -900,
"total_in_cents": -900,
"currency": "USD",
"refund_apply_order": "credit"
},
"isError": false
}