Create a refund


When you create a new refund, you must specify the Payment object on which to create it.

Creating a new refund will refund a payment that has previously been created but not yet fully refunded. Funds will be refunded to the shopper that was originally charged.

You can optionally refund only part of a charge. You can do so multiple times, until the entire payment has been refunded.

Once entirely refunded, a payment can’t be refunded again. This method will return an error when called on an already-refunded payment, or when trying to refund more money than is left on the payment.

Refunds are final and can not be reversed.

Errors

In addition to the Errors applicable to all API endpoints, the following errors are specific to creating a refund:

status code error code description
404 payment.not-found No payment was found meeting the requirements. Make sure to use the right paymentId and API key. test objects can only be accessed using test keys and live object with live keys.
403 amount.insufficient Available amount on payment is insufficient to handle the request.
Body Params

Create Refund

number
≥ 0

A positive amount representing how much of this payment to refund. You can refund only up to the remaining, unrefunded amount of the payment. If this is not set, the default will be the full unrefunded amount of the payment.

string
required

Three-letter ISO currency code, in uppercase. Must be a supported currency.

string
length between 1 and 80

An arbitrary - ideally descriptive - long form explanation of the Refund, meant to be displayed to the customer.

lineItems
array of objects

A list of the IDs of the Line Items of the original Payment this Refund is on.

lineItems
metadata
object

Set of up to 20 key-value pairs that you can attach to the object.

string
required

The unique identifier for the Payment object.

string
enum
required

The reason of the Refund

Allowed:
string
length between 1 and 40

A - ideally unique - string to reference the Refund which can be used to reconcile the Refund with your internal systems.

Responses

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