Create Refund
curl --request POST \
--url https://quickei.io/pay/sandbox/api/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_id": "<string>",
"amount": 123,
"reason": "<string>",
"reference": "<string>",
"idempotency_key": "<string>"
}
'import requests
url = "https://quickei.io/pay/sandbox/api/v1/refunds"
payload = {
"transaction_id": "<string>",
"amount": 123,
"reason": "<string>",
"reference": "<string>",
"idempotency_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: '<string>',
amount: 123,
reason: '<string>',
reference: '<string>',
idempotency_key: '<string>'
})
};
fetch('https://quickei.io/pay/sandbox/api/v1/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://quickei.io/pay/sandbox/api/v1/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([
'transaction_id' => '<string>',
'amount' => 123,
'reason' => '<string>',
'reference' => '<string>',
'idempotency_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://quickei.io/pay/sandbox/api/v1/refunds"
payload := strings.NewReader("{\n \"transaction_id\": \"<string>\",\n \"amount\": 123,\n \"reason\": \"<string>\",\n \"reference\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://quickei.io/pay/sandbox/api/v1/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"<string>\",\n \"amount\": 123,\n \"reason\": \"<string>\",\n \"reference\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://quickei.io/pay/sandbox/api/v1/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"<string>\",\n \"amount\": 123,\n \"reason\": \"<string>\",\n \"reference\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPOS API
Create Refund
Refund a payment (full or partial)
POST
/
refunds
Create Refund
curl --request POST \
--url https://quickei.io/pay/sandbox/api/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_id": "<string>",
"amount": 123,
"reason": "<string>",
"reference": "<string>",
"idempotency_key": "<string>"
}
'import requests
url = "https://quickei.io/pay/sandbox/api/v1/refunds"
payload = {
"transaction_id": "<string>",
"amount": 123,
"reason": "<string>",
"reference": "<string>",
"idempotency_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: '<string>',
amount: 123,
reason: '<string>',
reference: '<string>',
idempotency_key: '<string>'
})
};
fetch('https://quickei.io/pay/sandbox/api/v1/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://quickei.io/pay/sandbox/api/v1/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([
'transaction_id' => '<string>',
'amount' => 123,
'reason' => '<string>',
'reference' => '<string>',
'idempotency_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://quickei.io/pay/sandbox/api/v1/refunds"
payload := strings.NewReader("{\n \"transaction_id\": \"<string>\",\n \"amount\": 123,\n \"reason\": \"<string>\",\n \"reference\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://quickei.io/pay/sandbox/api/v1/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"<string>\",\n \"amount\": 123,\n \"reason\": \"<string>\",\n \"reference\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://quickei.io/pay/sandbox/api/v1/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"<string>\",\n \"amount\": 123,\n \"reason\": \"<string>\",\n \"reference\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRefund a completed payment, either fully or partially. The merchant wallet is debited and the user wallet is credited.
Success Response
Endpoint
POST https://quickei.io/pay/sandbox/api/v1/refunds
Parameters
string
required
The original payment transaction ID (e.g.
TRX-98765).decimal
Amount to refund. Omit for a full refund. Must be greater than 0 and not exceed the remaining refundable amount.
string
Reason for the refund (max 500 chars).
string
Your internal reference for this refund (max 255 chars).
string
Unique key to prevent duplicate refunds (max 64 chars).
Partial refunds: You can issue multiple partial refunds against the same transaction until the total refunded amount equals the original payment amount.
Example Request
curl -X POST https://quickei.io/pay/sandbox/api/v1/refunds \
-H "Authorization: Basic {base64_credentials}" \
-H "Content-Type: application/json" \
-d '{
"transaction_id": "TRX-98765",
"amount": 10.00,
"reason": "Item returned",
"reference": "RFD-2024-001",
"idempotency_key": "idem_rfd_abc123"
}'
Success Response 200
{
"message": {
"success": ["Refund created successfully"]
},
"data": {
"refund_id": "RF-20240115-X7Y8Z9",
"transaction_id": "TRX-98765",
"amount": "10.00 EUR",
"raw_amount": 10.00,
"currency": "EUR",
"status": "completed",
"reason": "Item returned",
"reference": "RFD-2024-001",
"created_at": "2024-01-15T16:30:00+00:00"
}
}
Response Fields
| Field | Description |
|---|---|
refund_id | Unique refund identifier (RF prefix) |
transaction_id | Original payment transaction ID |
amount | Formatted refund amount with currency |
raw_amount | Numeric refund amount |
currency | ISO 4217 currency code |
status | pending, completed, or failed |
reason | Refund reason (if provided) |
reference | Your internal reference (if provided) |
created_at | ISO 8601 timestamp |
Error Responses
404 Transaction not found
{
"message": {
"error": ["Transaction not found"]
}
}
422 Refund exceeds original amount
{
"message": {
"error": ["Refund amount exceeds the remaining refundable amount"]
}
}
422 Transaction not refundable
{
"message": {
"error": ["Transaction is not eligible for refund"]
}
}

