curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/refunds/ \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--data '
{
"payment_id": "PR2024120567891",
"refund_amount": "2250.00",
"reference_id": "RF-2026-0001"
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/refunds/"
payload = {
"payment_id": "PR2024120567891",
"refund_amount": "2250.00",
"reference_id": "RF-2026-0001"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-API-Version": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-API-Version': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_id: 'PR2024120567891',
refund_amount: '2250.00',
reference_id: 'RF-2026-0001'
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/refunds/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-pacb-uat.eximpe.com/pg/refunds/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_id' => 'PR2024120567891',
'refund_amount' => '2250.00',
'reference_id' => 'RF-2026-0001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/refunds/"
payload := strings.NewReader("{\n \"payment_id\": \"PR2024120567891\",\n \"refund_amount\": \"2250.00\",\n \"reference_id\": \"RF-2026-0001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-pacb-uat.eximpe.com/pg/refunds/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-API-Version", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"PR2024120567891\",\n \"refund_amount\": \"2250.00\",\n \"reference_id\": \"RF-2026-0001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/refunds/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"PR2024120567891\",\n \"refund_amount\": \"2250.00\",\n \"reference_id\": \"RF-2026-0001\"\n}"
response = http.request(request)
puts response.read_bodyCreate Refund
Create a new refund for a previously successful payment.
curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/refunds/ \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--data '
{
"payment_id": "PR2024120567891",
"refund_amount": "2250.00",
"reference_id": "RF-2026-0001"
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/refunds/"
payload = {
"payment_id": "PR2024120567891",
"refund_amount": "2250.00",
"reference_id": "RF-2026-0001"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-API-Version": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-API-Version': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_id: 'PR2024120567891',
refund_amount: '2250.00',
reference_id: 'RF-2026-0001'
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/refunds/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-pacb-uat.eximpe.com/pg/refunds/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_id' => 'PR2024120567891',
'refund_amount' => '2250.00',
'reference_id' => 'RF-2026-0001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/refunds/"
payload := strings.NewReader("{\n \"payment_id\": \"PR2024120567891\",\n \"refund_amount\": \"2250.00\",\n \"reference_id\": \"RF-2026-0001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-pacb-uat.eximpe.com/pg/refunds/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-API-Version", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"PR2024120567891\",\n \"refund_amount\": \"2250.00\",\n \"reference_id\": \"RF-2026-0001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/refunds/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"PR2024120567891\",\n \"refund_amount\": \"2250.00\",\n \"reference_id\": \"RF-2026-0001\"\n}"
response = http.request(request)
puts response.read_bodyImplementation Notes
- Retry with a
reference_id. If a call times out, send it again with the samereference_id,payment_idandrefund_amount. You get the original refund back, not a second one. The samereference_idwith a different amount is refused. - Refunds cannot add up to more than the payment. Refunds that have not failed count toward the payment amount. Two requests sent at once cannot both succeed if together they pass it; the second is refused.
- A successful call returns
201. The body carries therefund_idand thereference_id. The refund’s outcome follows in its status and by webhook.
Authorizations
Client Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.
Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.
API Version - Specifies which version of the API to use (e.g., '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which API version your integration uses. Default version information is available in the Developer Settings.
Body
Refund creation request
The ID of the payment to refund.
The amount to be refunded. Can be a partial amount.
Your own reference for this refund: letters, numbers and hyphens, up to 255 characters. Send the same value to retry safely: a repeat with the same payment and amount returns the original refund instead of creating a second one. A repeat with a different amount is refused. Generated for you when omitted.
URL that receives refund status updates for this refund.