curl --request POST \
--url https://api-v2.ziina.com/api/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"payment_intent_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"test": true
}
'import requests
url = "https://api-v2.ziina.com/api/refund"
payload = {
"id": "<string>",
"payment_intent_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"test": True
}
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({
id: '<string>',
payment_intent_id: '<string>',
amount: 123,
currency_code: '<string>',
test: true
})
};
fetch('https://api-v2.ziina.com/api/refund', 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-v2.ziina.com/api/refund",
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([
'id' => '<string>',
'payment_intent_id' => '<string>',
'amount' => 123,
'currency_code' => '<string>',
'test' => true
]),
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://api-v2.ziina.com/api/refund"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"payment_intent_id\": \"<string>\",\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"test\": true\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://api-v2.ziina.com/api/refund")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"payment_intent_id\": \"<string>\",\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.ziina.com/api/refund")
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 \"id\": \"<string>\",\n \"payment_intent_id\": \"<string>\",\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"test\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"payment_intent_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"status": "pending",
"created_at": "<string>",
"error": {
"message": "<string>",
"code": "<string>"
}
}Create refund
Issue customer refunds directly from your system using Ziina’s API. Ideal for handling returns, cancellations, and charge adjustments
curl --request POST \
--url https://api-v2.ziina.com/api/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"payment_intent_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"test": true
}
'import requests
url = "https://api-v2.ziina.com/api/refund"
payload = {
"id": "<string>",
"payment_intent_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"test": True
}
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({
id: '<string>',
payment_intent_id: '<string>',
amount: 123,
currency_code: '<string>',
test: true
})
};
fetch('https://api-v2.ziina.com/api/refund', 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-v2.ziina.com/api/refund",
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([
'id' => '<string>',
'payment_intent_id' => '<string>',
'amount' => 123,
'currency_code' => '<string>',
'test' => true
]),
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://api-v2.ziina.com/api/refund"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"payment_intent_id\": \"<string>\",\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"test\": true\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://api-v2.ziina.com/api/refund")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"payment_intent_id\": \"<string>\",\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.ziina.com/api/refund")
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 \"id\": \"<string>\",\n \"payment_intent_id\": \"<string>\",\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"test\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"payment_intent_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"status": "pending",
"created_at": "<string>",
"error": {
"message": "<string>",
"code": "<string>"
}
}write_refunds
scope.Authorizations
Body
Currency code of the amount to charge. This should be a 3-letter ISO-4217 currency code. For example, if you wish to charge 10 AED, you should pass AED. For more information on supported currencies, please visit the supported currencies page
Whether to create a test payment. Test payments do not require a payment method and can be used to test the payment flow. You won't be charged for this call. You can use test cards to test the payment flow.
Response
Currency code of the amount to charge. This should be a 3-letter ISO-4217 currency code. For example, if you wish to charge 10 AED, you should pass AED. For more information on supported currencies, please visit the supported currencies page
Was this page helpful?