Refund a payment

Issue a full or partial refund for a previously settled payment. By default, the full amount will be refunded unless a specific amount is provided for a partial refund.

If the payment was partially captured multiple times, you can specify which capture to refund by using the transaction event ID. Refer to the transactions.events array in the payment object to find available transaction event IDs (when the appropriate expand parameter is passed).

When specifying a transaction event ID, the refund amount should not exceed the amount captured in that event. If no refund amount is provided, it defaults to the amount captured in that specific event.

Path parameters

idstringRequired
ID of payment to refund.

Headers

X-API-KEYstringRequired
X-Idempotency-KeystringOptional
Optional key to make the request idempotent. Enables a safe retry of a request without risking the user being charged or refunded multiple times. The idempotency key must be generated by the client and needs to be unique for every new request.
X-API-VERSIONstringRequired

Specifies the version of the API to use. This must be set to 2.4.

Request

This endpoint expects an object.
amountlongOptional

The amount you would like to refund the customer, in minor units. e.g. for $7, use 700.

Defaults to remaining non-refunded amount.

orderIdstringOptional

Optionally you can pass a specific order ID for the refund.

By default this will be set to the original orderId given on payment creation.

reasonstringOptional
You can optionally specify a reason for the refund. This is for your own records.
transactionEventIdstringOptionalformat: "uuid"
Specific capture ID to target for the refund. Use this to specify which transaction event the refund should apply to.
expandlist of "transactions.events"Optional
A list of fields to expand, such as transactions.events.

Response

Successful Response
idstring or null
The unique payment ID. You can use this ID to retrieve the payment details, or perform downstream operations.
datedatetime or null
The date and time at which the payment was created in UTC format.
dateUpdateddatetime or null
The date and time of the last payment update in UTC format.
statusenum or null

See the payment status table for more information.

cardTokenTypeenum or null
The type of card token used for the payment. Only applies for card payments.
Allowed values:
orderIdstring or null<=256 characters
Your reference for the payment.
currencyCodeenum or null

The 3-letter currency code in ISO 4217 format. e.g. use USD for US dollars.

amountlong or null
The amount you charged the customer, in minor units.
orderobject or null
More information associated with the order.
customerIdstring or null<=256 characters
The unique identifier for your customer.
customerobject or null
More information associated with the customer.
metadatamap from strings to any or null
Additional data to be used throughout the payment lifecycle.
paymentMethodobject or null
The payment method options provided in the request, as well as the token used to process the payment.
processorobject or null
More information associated with the payment processor, including the processor name.
requiredActionobject or null
Required action to perform in order to resume the payment workflow. This can be requiring a 3DS check from the customer for instance.
statusReasonobject or null

Check this field for more information regarding the payment’s status. This is especially useful when the status is DECLINED or FAILED.

transactionslist of objects or null

A list summarizing the transactions that occurred while processing the payment.

Note: a refund is a separate transaction and so will appear in this transactions list if a refund was performed.

riskDataobject or null
Risk data associated with this payment.

Errors