Refund Attempts
curl --request POST \
--url https://api.paytring.com/api/v2/order/refund/attempts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"order_id": "<string>",
"hash": "null"
}
'import requests
url = "https://api.paytring.com/api/v2/order/refund/attempts"
payload = {
"key": "<string>",
"order_id": "<string>",
"hash": "null"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', order_id: '<string>', hash: 'null'})
};
fetch('https://api.paytring.com/api/v2/order/refund/attempts', 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.paytring.com/api/v2/order/refund/attempts",
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([
'key' => '<string>',
'order_id' => '<string>',
'hash' => 'null'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.paytring.com/api/v2/order/refund/attempts"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"order_id\": \"<string>\",\n \"hash\": \"null\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.paytring.com/api/v2/order/refund/attempts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"order_id\": \"<string>\",\n \"hash\": \"null\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paytring.com/api/v2/order/refund/attempts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"order_id\": \"<string>\",\n \"hash\": \"null\"\n}"
response = http.request(request)
puts response.read_body"{\n \"status\": true,\n \"message\": \"Refund attempts fetched successfully\",\n \"data\": [\n {\n \"refund_id\": \"7230436xxxxxx48056\",\n \"amount\": 100,\n \"type\": \"Full\",\n \"status\": \"success\",\n \t\"rrn\": \"xxxxxxxxxxxxxxxxxxx\",\n \"attempted_at\": \"2xxx-0x-23T07:55:30.000000Z\"\n }\n ],\n \"request_id\": x67af25xxxxxxx\"\n}""{}"Paytring Checkout Payment
Refund Attempts
This takes an order id and returns all associated refunds with that Order ID.
POST
/
api
/
v2
/
order
/
refund
/
attempts
Refund Attempts
curl --request POST \
--url https://api.paytring.com/api/v2/order/refund/attempts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"order_id": "<string>",
"hash": "null"
}
'import requests
url = "https://api.paytring.com/api/v2/order/refund/attempts"
payload = {
"key": "<string>",
"order_id": "<string>",
"hash": "null"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', order_id: '<string>', hash: 'null'})
};
fetch('https://api.paytring.com/api/v2/order/refund/attempts', 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.paytring.com/api/v2/order/refund/attempts",
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([
'key' => '<string>',
'order_id' => '<string>',
'hash' => 'null'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.paytring.com/api/v2/order/refund/attempts"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"order_id\": \"<string>\",\n \"hash\": \"null\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.paytring.com/api/v2/order/refund/attempts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"order_id\": \"<string>\",\n \"hash\": \"null\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paytring.com/api/v2/order/refund/attempts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"order_id\": \"<string>\",\n \"hash\": \"null\"\n}"
response = http.request(request)
puts response.read_body"{\n \"status\": true,\n \"message\": \"Refund attempts fetched successfully\",\n \"data\": [\n {\n \"refund_id\": \"7230436xxxxxx48056\",\n \"amount\": 100,\n \"type\": \"Full\",\n \"status\": \"success\",\n \t\"rrn\": \"xxxxxxxxxxxxxxxxxxx\",\n \"attempted_at\": \"2xxx-0x-23T07:55:30.000000Z\"\n }\n ],\n \"request_id\": x67af25xxxxxxx\"\n}""{}"This API retrieves the list of refund attempts for a specific order.
Request Parameters
key(string): Merchant API keyorder_id(string): Order IDhash(string): Calculated hash for request validation
Responses
200 OK
{
"status": true,
"refund_attempts": [
{
"attempt_id": "string",
"status": "processed",
"amount": 50
},
{
"attempt_id": "string",
"status": "failed",
"amount": 30
}
]
}
400 Bad Request
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Response
200
⌘I

