Request Transaction Refund
curl --request POST \
--url https://{brand_domain}/api/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trx_id": "OP-481029304",
"transaction_id": 45,
"amount": "150.00",
"reason": "Customer requested return"
}
'import requests
url = "https://{brand_domain}/api/v1/refunds"
payload = {
"trx_id": "OP-481029304",
"transaction_id": 45,
"amount": "150.00",
"reason": "Customer requested return"
}
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({
trx_id: 'OP-481029304',
transaction_id: 45,
amount: '150.00',
reason: 'Customer requested return'
})
};
fetch('https://{brand_domain}/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://{brand_domain}/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([
'trx_id' => 'OP-481029304',
'transaction_id' => 45,
'amount' => '150.00',
'reason' => 'Customer requested return'
]),
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://{brand_domain}/api/v1/refunds"
payload := strings.NewReader("{\n \"trx_id\": \"OP-481029304\",\n \"transaction_id\": 45,\n \"amount\": \"150.00\",\n \"reason\": \"Customer requested return\"\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://{brand_domain}/api/v1/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trx_id\": \"OP-481029304\",\n \"transaction_id\": 45,\n \"amount\": \"150.00\",\n \"reason\": \"Customer requested return\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{brand_domain}/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 \"trx_id\": \"OP-481029304\",\n \"transaction_id\": 45,\n \"amount\": \"150.00\",\n \"reason\": \"Customer requested return\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 12,
"uuid": "d2f44778-d421-4f1e-9271-70bf8e3b123a",
"transaction_id": 45,
"trx_id": "OP-481029304",
"gateway_trx_id": "A8K9D2J3S",
"amount": "150.00",
"reason": "Customer requested return",
"status": "completed",
"processed_at": "2026-06-23T14:20:00Z",
"created_at": "2026-06-23T14:19:55Z"
}
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}Request Transaction Refund
Requests a refund (full or partial) for a completed transaction. Verifies and validates that the requested refund amount does not exceed the remaining refundable balance of the original transaction.
POST
/
refunds
Request Transaction Refund
curl --request POST \
--url https://{brand_domain}/api/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trx_id": "OP-481029304",
"transaction_id": 45,
"amount": "150.00",
"reason": "Customer requested return"
}
'import requests
url = "https://{brand_domain}/api/v1/refunds"
payload = {
"trx_id": "OP-481029304",
"transaction_id": 45,
"amount": "150.00",
"reason": "Customer requested return"
}
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({
trx_id: 'OP-481029304',
transaction_id: 45,
amount: '150.00',
reason: 'Customer requested return'
})
};
fetch('https://{brand_domain}/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://{brand_domain}/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([
'trx_id' => 'OP-481029304',
'transaction_id' => 45,
'amount' => '150.00',
'reason' => 'Customer requested return'
]),
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://{brand_domain}/api/v1/refunds"
payload := strings.NewReader("{\n \"trx_id\": \"OP-481029304\",\n \"transaction_id\": 45,\n \"amount\": \"150.00\",\n \"reason\": \"Customer requested return\"\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://{brand_domain}/api/v1/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trx_id\": \"OP-481029304\",\n \"transaction_id\": 45,\n \"amount\": \"150.00\",\n \"reason\": \"Customer requested return\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{brand_domain}/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 \"trx_id\": \"OP-481029304\",\n \"transaction_id\": 45,\n \"amount\": \"150.00\",\n \"reason\": \"Customer requested return\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 12,
"uuid": "d2f44778-d421-4f1e-9271-70bf8e3b123a",
"transaction_id": 45,
"trx_id": "OP-481029304",
"gateway_trx_id": "A8K9D2J3S",
"amount": "150.00",
"reason": "Customer requested return",
"status": "completed",
"processed_at": "2026-06-23T14:20:00Z",
"created_at": "2026-06-23T14:19:55Z"
}
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}Authorizations
Provide the Bearer API Key generated for your brand.
Body
application/json
OwnPay transaction reference code (e.g. OP-12345) or gateway transaction ID.
Example:
"OP-481029304"
Alternative key using the internal transaction integer ID.
Example:
45
Optional positive numeric string to issue a partial refund. If omitted, a full refund is requested.
Example:
"150.00"
Refund reason justification.
Example:
"Customer requested return"
Last modified on July 12, 2026
Related topics
Transactions - View Payments, Refunds, and Gateway StatusRetrieve RefundList RefundsNode.js SDK - TypeScript-First Payment IntegrationRetrieve TransactionWas this page helpful?
⌘I