Cancel Refund | Refunds API
curl --request DELETE \
--url https://api.atoa.me/api/refund/{refundId}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.atoa.me/api/refund/{refundId}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.atoa.me/api/refund/{refundId}/cancel', 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.atoa.me/api/refund/{refundId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.atoa.me/api/refund/{refundId}/cancel"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.atoa.me/api/refund/{refundId}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atoa.me/api/refund/{refundId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Refund cancelled successfully",
"refundId": "4fcddd66-4425-4bf7-88cc-96463e279eb1"
}
{
"name": "BadRequestException",
"message": "Refund not found"
}
Refunds
Cancel Refund | Refunds API
Cancel refund via the Atoa Refunds API, request parameters, response schema and code samples in cURL, Python, JavaScript, PHP, Go and Java.
DELETE
/
api
/
refund
/
{refundId}
/
cancel
Cancel Refund | Refunds API
curl --request DELETE \
--url https://api.atoa.me/api/refund/{refundId}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.atoa.me/api/refund/{refundId}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.atoa.me/api/refund/{refundId}/cancel', 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.atoa.me/api/refund/{refundId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.atoa.me/api/refund/{refundId}/cancel"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.atoa.me/api/refund/{refundId}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atoa.me/api/refund/{refundId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Refund cancelled successfully",
"refundId": "4fcddd66-4425-4bf7-88cc-96463e279eb1"
}
{
"name": "BadRequestException",
"message": "Refund not found"
}
This API allows you to cancel a refund that is still in a pending state and has not yet been processed. Once canceled, the refund will not be disbursed to the customer’s bank account.
You can only cancel refunds that are in a pending state and have not been
processed yet.
Sandbox environment refund cancellations cannot be simulated.
Authorization
Bearer<token>
Request Body Schema
string
required
The unique identifier of the refund you want to cancel. This is the refundId
that was returned when you initiated the refund from
Initiate Refund.
Response
number
The HTTP status code indicating the result of the operation. A value of 200
indicates success.
string
A human-readable message describing the result of the operation.
string
The unique identifier of the refund that was cancelled.
{
"status": 200,
"message": "Refund cancelled successfully",
"refundId": "4fcddd66-4425-4bf7-88cc-96463e279eb1"
}
{
"name": "BadRequestException",
"message": "Refund not found"
}