List refunds
curl --request GET \
--url https://merchant-api-prod.anyway.sh/v1/refunds \
--header 'X-API-Key: <api-key>'import requests
url = "https://merchant-api-prod.anyway.sh/v1/refunds"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://merchant-api-prod.anyway.sh/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://merchant-api-prod.anyway.sh/v1/refunds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://merchant-api-prod.anyway.sh/v1/refunds"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://merchant-api-prod.anyway.sh/v1/refunds")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-api-prod.anyway.sh/v1/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"current": 123,
"page": 123,
"pages": 123,
"records": [
{
"amountCents": 123,
"createdAt": "<string>",
"currency": "<string>",
"failedAt": "<string>",
"failureReason": "<string>",
"fullyRefunded": true,
"orderId": "<string>",
"orgId": "<string>",
"reason": "<string>",
"refundId": "<string>",
"refundedAt": "<string>",
"status": "<string>",
"totalRefundedCents": 123
}
],
"size": 123,
"total": 123
},
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}Merchant API endpoints
List refunds
List the authenticated organization’s refunds with filters, for reconciliation.
GET
/
v1
/
refunds
List refunds
curl --request GET \
--url https://merchant-api-prod.anyway.sh/v1/refunds \
--header 'X-API-Key: <api-key>'import requests
url = "https://merchant-api-prod.anyway.sh/v1/refunds"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://merchant-api-prod.anyway.sh/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://merchant-api-prod.anyway.sh/v1/refunds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://merchant-api-prod.anyway.sh/v1/refunds"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://merchant-api-prod.anyway.sh/v1/refunds")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-api-prod.anyway.sh/v1/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"current": 123,
"page": 123,
"pages": 123,
"records": [
{
"amountCents": 123,
"createdAt": "<string>",
"currency": "<string>",
"failedAt": "<string>",
"failureReason": "<string>",
"fullyRefunded": true,
"orderId": "<string>",
"orgId": "<string>",
"reason": "<string>",
"refundId": "<string>",
"refundedAt": "<string>",
"status": "<string>",
"totalRefundedCents": 123
}
],
"size": 123,
"total": 123
},
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "<string>",
"message": "<string>"
},
"message": "<string>",
"success": true
}Authenticate with an API key that belongs to the target organization.
Each refund has the same fields as the
refund.succeeded and refund.failed
webhooks, so you can reconcile events and API reads with
the same code. status is succeeded, failed, or pending (still awaiting review or
processing). No webhook is sent for pending; the refund sends refund.succeeded or
refund.failed when it ends.
To reconcile a period, filter by date_from and date_to and page through the results. To
see every refund on one order, filter by order_id. totalRefundedCents and fullyRefunded
describe the order at the time of the request. A webhook carries them as of its event, so once a later refund on the same order
succeeds, the API shows a higher total than that earlier webhook did.Authorizations
Merchant API key (format: ak_BASE64)
Query Parameters
Page number
Page size (max 100)
Filter by order ID (ORD_...)
succeeded, failed or pending
Refunds requested at or after this unix timestamp
Refunds requested at or before this unix timestamp