On this page:
Overview
You can:
- Refund all successfully authorised transactions processed through your account.
- Refund transaction payments made by your customer for up to 2 years after the original transaction, or until the card is expired.
- Refund an amount that is less than the original payment transaction. (A partial refund).
- Refund a transaction one or more times as long as the sum of the refunds does not exceed the original transaction amount.
Ensure you wait for a success or failure response before retrying.
Performing a Refund
You need two pieces of information to perform a refund:
- The original transactionId.
- The amount you want to refund.
For example:
curl https://pi-test.sagepay.com/api/v1/transactions \ -H "Authorization: Basic aEpZeHN3N0hM...ejRqNVVzNXU=" \ -H "Content-type: application/json" \ -X POST \ -d '{ "transactionType":"Refund", "vendorTxCode":"repeat_xx00001", "referenceTransactionId":"64B09E5F-2353-3B03-AD56-2DAF85C362B9", "amount":"2000", "currency":"GBP", "description":"Bad product refunded" }'
A Successful Refund Response
You will receive a response for a successfully authorised refund similar to the following example:
{ "statusCode":"0000", "statusDetail":"The Authorisation was Successful.", "transactionId":"63629843-AC44-8690-8947-81132A2FB395", "transactionType":"Refund", "retrievalReference":"12260787", "bankAuthorisationCode":"999777", "paymentMethod":{ "card":{ "cardType":"Visa", "lastFourDigits":"0006", "expiryDate":"1120" } }, "status":"Ok" }
Refund Problems
When the sum of the refunds made for a transaction exceeds the original transaction amount you will receive a response similar to the following example:
{ "description":"This refund amount will exceed the amount of the original transaction", "code":"1018" }