A seamless integration to Super Instant Refunds.

📘

Getting Started

Take a look at the Overview before you start. Here you'll get familiar with the API call sequence, authentication, and how you refund a customer using Super Payments via a webhook you'll need to provide.

Any queries about the best way to implement Super to your store's checkout? Contact us at any time: [email protected].

1. Integrate with the Payments API

Make sure you've completed your integration with the Payments API first.

2. Add your e-commerce storefront details

2.1 Implement your refunds callback url

You need to implement a webhook for Refunds before you can complete your setup. This webhook is called by the Super Payments gateway to inform you of refund status.

2.2 Set your refund callback url

Once you've got your Super Payments refunds url live, add your refunds callback url to your business portal.

697

2.3 Capture Brand ID

A brand must be specified when interacting with the payments, refunds and rewards API's.

To retrieve the correct brand ID, visit the Developers, API keys section on the business portal.

697

Viewing brand ID's

3. Initiate a refund

You should initiate a refund request passing in your transactionID

❗️

Code snippet

Please treat the following code snippets as illustrative examples rather than working code.

curl --request POST \
     --url https://api.superpayments.com/2024-02-01/refunds \
     --header 'Authorization: <<apiKey>>' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "transactionId": "<<paymentTransactionId>>",
  "amount": 10000,
  "currency": "GBP",
  "externalReference": "refund101",
  "brandId": "<<brandId>>"
}
'

4 Handle Refund Notifications

We will make a POST request to the refund callback url specified in your Payment Method Configuration whenever there is an update to the refund state (e.g. on RefundSuccess or RefundFailed).

You should update the state of your order based on this request

An example of the POST content:

{
  "externalReference": "xxxxx",
  "transactionStatus": "RefundSuccess",
  "transactionReference": "REXXXXXXXXXXXXXXX",
  "eventType": "RefundStatus",
  "transactionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}