Create a Refund
curl --request POST \
--url https://sandbox.api.hixbe.com/payment/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Xerobi-Version: <xerobi-version>' \
--data '
{
"charge": "ch_1Hh2Z3AbCdEf",
"amount": 500,
"reason": "requested_by_customer"
}
'import requests
url = "https://sandbox.api.hixbe.com/payment/refunds"
payload = {
"charge": "ch_1Hh2Z3AbCdEf",
"amount": 500,
"reason": "requested_by_customer"
}
headers = {
"Xerobi-Version": "<xerobi-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Xerobi-Version': '<xerobi-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({charge: 'ch_1Hh2Z3AbCdEf', amount: 500, reason: 'requested_by_customer'})
};
fetch('https://sandbox.api.hixbe.com/payment/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://sandbox.api.hixbe.com/payment/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([
'charge' => 'ch_1Hh2Z3AbCdEf',
'amount' => 500,
'reason' => 'requested_by_customer'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Xerobi-Version: <xerobi-version>"
],
]);
$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://sandbox.api.hixbe.com/payment/refunds"
payload := strings.NewReader("{\n \"charge\": \"ch_1Hh2Z3AbCdEf\",\n \"amount\": 500,\n \"reason\": \"requested_by_customer\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Xerobi-Version", "<xerobi-version>")
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://sandbox.api.hixbe.com/payment/refunds")
.header("Xerobi-Version", "<xerobi-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"charge\": \"ch_1Hh2Z3AbCdEf\",\n \"amount\": 500,\n \"reason\": \"requested_by_customer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.hixbe.com/payment/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Xerobi-Version"] = '<xerobi-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"charge\": \"ch_1Hh2Z3AbCdEf\",\n \"amount\": 500,\n \"reason\": \"requested_by_customer\"\n}"
response = http.request(request)
puts response.read_body{
"id": "re_123",
"charge": "<string>",
"amount": 123,
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Create Refund
Issue a full or partial refund for a charge. Use Idempotency-Key to protect retries.
POST
/
refunds
Create a Refund
curl --request POST \
--url https://sandbox.api.hixbe.com/payment/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Xerobi-Version: <xerobi-version>' \
--data '
{
"charge": "ch_1Hh2Z3AbCdEf",
"amount": 500,
"reason": "requested_by_customer"
}
'import requests
url = "https://sandbox.api.hixbe.com/payment/refunds"
payload = {
"charge": "ch_1Hh2Z3AbCdEf",
"amount": 500,
"reason": "requested_by_customer"
}
headers = {
"Xerobi-Version": "<xerobi-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Xerobi-Version': '<xerobi-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({charge: 'ch_1Hh2Z3AbCdEf', amount: 500, reason: 'requested_by_customer'})
};
fetch('https://sandbox.api.hixbe.com/payment/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://sandbox.api.hixbe.com/payment/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([
'charge' => 'ch_1Hh2Z3AbCdEf',
'amount' => 500,
'reason' => 'requested_by_customer'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Xerobi-Version: <xerobi-version>"
],
]);
$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://sandbox.api.hixbe.com/payment/refunds"
payload := strings.NewReader("{\n \"charge\": \"ch_1Hh2Z3AbCdEf\",\n \"amount\": 500,\n \"reason\": \"requested_by_customer\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Xerobi-Version", "<xerobi-version>")
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://sandbox.api.hixbe.com/payment/refunds")
.header("Xerobi-Version", "<xerobi-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"charge\": \"ch_1Hh2Z3AbCdEf\",\n \"amount\": 500,\n \"reason\": \"requested_by_customer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.hixbe.com/payment/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Xerobi-Version"] = '<xerobi-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"charge\": \"ch_1Hh2Z3AbCdEf\",\n \"amount\": 500,\n \"reason\": \"requested_by_customer\"\n}"
response = http.request(request)
puts response.read_body{
"id": "re_123",
"charge": "<string>",
"amount": 123,
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Authorizations
Use your secret API key. Example: Authorization: Bearer sk_test_xxx
Headers
API version header. Use '2026-01-01' for the latest version.
Idempotency key for safely retrying POST requests.