HomeProduct DocsAPI ReferenceChangelog
RecurlyAPI GuidesRecurly.jsWebhooksAPI ReferenceSupportBook demo
API Reference

Refund an invoice

There are two ways to do a refund:

  • Apply a specific dollar/cent amount or percentage amount to an entire invoice, which will refund the resulting amount across all line items on the invoice.
    • If you want to refund the entire refundable amount on the invoice, the simplest way is to do type=amount without specifiying an amount.
    • Note: You must have the Credit Memos feature flag enabled on your site to utilize percentage amount refunds on invoices.
  • Apply a refund to one or more individual line items on an invoice. A line item can be refunded by a quantity amount, a specific dollar/cent amount, or a percentage amount and will only apply to the specific line item you are aiming to refund.
    • Note: You must have the Credit Memos feature flag enabled on your site to utilize specific dollar/cent amount and percentage amount refunds on line items.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Invoice ID or number. For ID no prefix is used e.g. e28zov4fw0v2. For number use prefix number-, e.g. number-1000. For number with prefix or country code, use number- and prefix, e.g. number-TEST-FR1001

Body Params
string
enum
required

The type of refund. Amount and line items cannot both be specified in the request.

Allowed:
float

The amount to be refunded. The amount will be split between the line items.
If type is "amount" and no amount is specified, it will default to refunding the total refundable amount on the invoice. Can only be present if type is "amount".

integer
1 to 100

The percentage of the remaining balance to be refunded. The percentage will be split between the line items. If type is "percentage" and no percentage is specified, it will default to refunding 100% of the refundable amount on the invoice. Can only be present if type is "percentage".

line_items
array of objects

The line items to be refunded. This is required when type=line_items.

Line items
string
enum
Defaults to credit_first

Indicates how the invoice should be refunded when both a credit and transaction are present on the invoice:

  • transaction_first – Refunds the transaction first, then any amount is issued as credit back to the account. Default value when Credit Invoices feature is enabled.
  • credit_first – Issues credit back to the account first, then refunds any remaining amount back to the transaction. Default value when Credit Invoices feature is not enabled.
  • all_credit – Issues credit to the account for the entire amount of the refund. Only available when the Credit Invoices feature is enabled.
  • all_transaction – Refunds the entire amount back to transactions, using transactions from previous invoices if necessary. Only available when the Credit Invoices feature is enabled.
Allowed:
string

Used as the Customer Notes on the credit invoice.

This field can only be include when the Credit Invoices feature is enabled.

external_refund
object

Indicates that the refund was settled outside of Recurly, and a manual transaction should be created to track it in Recurly.

Required when:

  • refunding a manually collected charge invoice, and refund_method is not all_credit
  • refunding a credit invoice that refunded manually collecting invoices
  • refunding a credit invoice for a partial amount

This field can only be included when the Credit Invoices feature is enabled.

Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json