Hosted Payment Page
A simple guide to integrate with Super Payments using our hosted payment page.
Here's how to start taking payment and issuing refunds for your customers.
Payments
Integrating with the Payments API is simple.
- Generate a reward calculation based on your payment amount
- Initiate a payment, and redirect your customer to pay with Super Payments.
- Handle the payment response via a webhook to create an order, or return your customer back to checkout.
You'll find details for Super Payments authentication here.
Simply follow the Payments API instructions to directly integrate with the Super Payments public API.
Here's a shell command example of the reward-calculations/ and payments/ requests you can try out yourself...
Code snippets
Please treat the following code snippets as illustrative examples rather than working code.
curl --request POST \
--url https://api.superpayments.com/2024-02-01/reward-calculations \
--header 'Authorization: <<apiKey>>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"amount":91234,
"brandId": "<<brandId>>",
"currency":"GBP"
}'
'
'
The response from the reward-calculations
request will provide you with the rewardCalculationId
that you must pass in the request to the payments
api.
curl --request POST \
--url https://api.superpayments.com/2024-02-01/payments \
--header 'Authorization: <<apiKey>>' \
--header 'accept: application/json' \
--header 'content-type: application/json'
--data '{
"brandId":"<<brandId>>",
"amount":91234,
"rewardCalculationId":"<<rewardCalculationId>>",
"currency":"GBP",
"successUrl": "https://www.yourwebsite.com/success.html",
"cancelUrl": "https://www.yourwebsite.com/cancel.html",
"failureUrl": "https://www.yourwebsite.com/fail.html"
}'
Refunds
Processing an instant full or partial refunds with Refunds API is simple.
- Initiate a refund
- Handle the refund response via a webhook to process the refund. You must provide this webhook to receive these updates from Super Payments.
You'll find details for Super Payments authentication here.
Simply follow the Refunds API instructions to directly integration with Super Payments public API.
Here's a shell command example of the refunds/ requests you can try out yourself...
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>>"
}
'
Rewards Configuration
Use the Get Reward Configuration Endpoint to retrieve the current rewards configuration for a specific brand.
curl --request GET \
--url https://api.superpayments.com/2024-02-01/brands/<<brandId>>/reward-configuration \
--header 'Authorization: <<apiKey>>' \
--header 'accept: application/json'
Update the existing configuration with the Upsert Brand Reward Configuration Endpoint
curl --request PUT \
--url https://api.superpayments.com/2024-02-01/brands/<<brandId>>/reward-configuration \
--header 'Authorization: <<apiKey>>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"rewardPercentage": 1,
"minimumSpend": {
"currency": "GBP",
"amount": 1000
},
"rewardsExpireAfter": 864000
}
'
Updated about 1 month ago