Refund invoice
Refund a line item or the whole invoice by quantity, amount or percentage.
POST https://cotlet.dev/api/v1/recurly/invoices/{invoice_number}/refund
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. |
Request
curl -X POST https://cotlet.dev/api/v1/recurly/invoices/1042/refund \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method":"quantity","line_item_id":"3dc1a8f09b4c4e55a1e0","quantity":1,"refund_apply_order":"credit"}' result = client.call("recurly", "refund_invoice", {"invoice_number":"1042","method":"quantity","line_item_id":"3dc1a8f09b4c4e55a1e0","quantity":1,"refund_apply_order":"credit"}) const result = await cotlet.call('recurly', 'refund_invoice', {"invoice_number":"1042","method":"quantity","line_item_id":"3dc1a8f09b4c4e55a1e0","quantity":1,"refund_apply_order":"credit"}); cotlet call recurly refund_invoice --data '{"invoice_number":"1042","method":"quantity","line_item_id":"3dc1a8f09b4c4e55a1e0","quantity":1,"refund_apply_order":"credit"}' Example response
{
"refund_invoice_number": "1105",
"original_invoice_number": "1042",
"state": "collected",
"subtotal_in_cents": -900,
"total_in_cents": -900,
"currency": "USD",
"refund_apply_order": "credit"
}