Create a credit refund
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/billing/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credit_transaction_id": "ctx_01HZY8CREDITLOT",
"amount_cents": 5000,
"reason": "Customer overpaid on top-up"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/billing/refunds"
payload = {
"credit_transaction_id": "ctx_01HZY8CREDITLOT",
"amount_cents": 5000,
"reason": "Customer overpaid on top-up"
}
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({
credit_transaction_id: 'ctx_01HZY8CREDITLOT',
amount_cents: 5000,
reason: 'Customer overpaid on top-up'
})
};
fetch('https://api.orbit.devotel.io/api/v1/billing/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://api.orbit.devotel.io/api/v1/billing/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([
'credit_transaction_id' => 'ctx_01HZY8CREDITLOT',
'amount_cents' => 5000,
'reason' => 'Customer overpaid on top-up'
]),
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.orbit.devotel.io/api/v1/billing/refunds"
payload := strings.NewReader("{\n \"credit_transaction_id\": \"ctx_01HZY8CREDITLOT\",\n \"amount_cents\": 5000,\n \"reason\": \"Customer overpaid on top-up\"\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.orbit.devotel.io/api/v1/billing/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credit_transaction_id\": \"ctx_01HZY8CREDITLOT\",\n \"amount_cents\": 5000,\n \"reason\": \"Customer overpaid on top-up\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/billing/refunds")
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 \"credit_transaction_id\": \"ctx_01HZY8CREDITLOT\",\n \"amount_cents\": 5000,\n \"reason\": \"Customer overpaid on top-up\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"refund": {
"id": "refund_9f2c1a7b4e0d4c6f8a1b2c3d4e5f6071",
"organization_id": "org_01HZY8ORG",
"credit_transaction_id": "ctx_01HZY8CREDITLOT",
"amount_cents": 5000,
"reason": "Customer overpaid on top-up",
"status": "processed",
"stripe_refund_id": "re_1PEXAMPLE",
"created_at": "2026-08-02T12:00:00.000Z",
"processed_at": "2026-08-02T12:00:01.000Z"
}
},
"meta": {
"request_id": "req_01HZY8EXAMPLE",
"timestamp": "2026-08-02T12:00:00.000Z"
}
}Billing
Create a credit refund
Refunds part or all of a credit-purchase lot back to the original payment method. Reference the lot with credit_transaction_id and the amount in amount_cents; the request only succeeds when the lot is a credit purchase, is within the 30-day refund window, and still has an unused refundable balance. On success the refund is issued at the provider, a matching offset is written to the ledger, and the wallet is debited. Owner-role only.
POST
/
api
/
v1
/
billing
/
refunds
Create a credit refund
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/billing/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credit_transaction_id": "ctx_01HZY8CREDITLOT",
"amount_cents": 5000,
"reason": "Customer overpaid on top-up"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/billing/refunds"
payload = {
"credit_transaction_id": "ctx_01HZY8CREDITLOT",
"amount_cents": 5000,
"reason": "Customer overpaid on top-up"
}
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({
credit_transaction_id: 'ctx_01HZY8CREDITLOT',
amount_cents: 5000,
reason: 'Customer overpaid on top-up'
})
};
fetch('https://api.orbit.devotel.io/api/v1/billing/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://api.orbit.devotel.io/api/v1/billing/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([
'credit_transaction_id' => 'ctx_01HZY8CREDITLOT',
'amount_cents' => 5000,
'reason' => 'Customer overpaid on top-up'
]),
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.orbit.devotel.io/api/v1/billing/refunds"
payload := strings.NewReader("{\n \"credit_transaction_id\": \"ctx_01HZY8CREDITLOT\",\n \"amount_cents\": 5000,\n \"reason\": \"Customer overpaid on top-up\"\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.orbit.devotel.io/api/v1/billing/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credit_transaction_id\": \"ctx_01HZY8CREDITLOT\",\n \"amount_cents\": 5000,\n \"reason\": \"Customer overpaid on top-up\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/billing/refunds")
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 \"credit_transaction_id\": \"ctx_01HZY8CREDITLOT\",\n \"amount_cents\": 5000,\n \"reason\": \"Customer overpaid on top-up\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"refund": {
"id": "refund_9f2c1a7b4e0d4c6f8a1b2c3d4e5f6071",
"organization_id": "org_01HZY8ORG",
"credit_transaction_id": "ctx_01HZY8CREDITLOT",
"amount_cents": 5000,
"reason": "Customer overpaid on top-up",
"status": "processed",
"stripe_refund_id": "re_1PEXAMPLE",
"created_at": "2026-08-02T12:00:00.000Z",
"processed_at": "2026-08-02T12:00:01.000Z"
}
},
"meta": {
"request_id": "req_01HZY8EXAMPLE",
"timestamp": "2026-08-02T12:00:00.000Z"
}
}Authorizations
BearerApiKey
Dashboard JWT token from Clerk
Body
application/json
Id of the credit_purchase lot to refund against.
Maximum string length:
128Amount to refund, in wallet cents. Must not exceed the lot's remaining refundable balance.
Required range:
1 <= x <= 1000000000Optional reason attached to the refund and audit log.
Maximum string length:
500⌘I