Advanced Billing
Add Unbilled Charge
Add an unbilled charge to a subscription that will be included on the next invoice.
POST
/
v1
/
subscriptions
/
{id}
/
charges
Add an unbilled (ad-hoc) charge
curl --request POST \
--url https://billing.example.com/v1/subscriptions/{id}/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"hsn_code": "<string>"
}
'import requests
url = "https://billing.example.com/v1/subscriptions/{id}/charges"
payload = {
"amount": 123,
"currency": "<string>",
"description": "<string>",
"hsn_code": "<string>"
}
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({
amount: 123,
currency: '<string>',
description: '<string>',
hsn_code: '<string>'
})
};
fetch('https://billing.example.com/v1/subscriptions/{id}/charges', 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://billing.example.com/v1/subscriptions/{id}/charges",
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([
'amount' => 123,
'currency' => '<string>',
'description' => '<string>',
'hsn_code' => '<string>'
]),
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://billing.example.com/v1/subscriptions/{id}/charges"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"hsn_code\": \"<string>\"\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://billing.example.com/v1/subscriptions/{id}/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"hsn_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/subscriptions/{id}/charges")
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 \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"hsn_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"description": "<string>",
"hsn_code": "<string>",
"status": "pending",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the subscription (e.g., sub_3jF6RtKmWp). |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | int64 | Yes | Charge amount in the smallest currency unit (e.g., cents). Must be a positive integer. |
currency | string | Yes | Three-letter ISO currency code (e.g., usd, eur). |
description | string | Yes | A human-readable description of the charge. |
chrg_ prefix.
Example Request
curl -X POST https://api.recurso.io/v1/subscriptions/sub_3jF6RtKmWp/charges \
-H "Authorization: Bearer sk_live_26PHem9AhJZvU..." \
-H "Content-Type: application/json" \
-d '{
"amount": 7500,
"currency": "usd",
"description": "One-time onboarding fee"
}'
Response
{
"id": "chrg_6kW2NpTsXv",
"object": "charge",
"status": "pending",
"amount": 7500,
"currency": "usd",
"description": "One-time onboarding fee",
"subscription_id": "sub_3jF6RtKmWp",
"invoice_id": null,
"created_at": "2026-06-23T09:20:00Z",
"updated_at": "2026-06-23T09:20:00Z"
}
Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Path Parameters
Body
application/json
Response
Charge recorded.
Amount in the lowest currency unit.
HSN/SAC code the charge is taxed at on the invoice.
Available options:
pending, invoiced, canceled ⌘I
Add an unbilled (ad-hoc) charge
curl --request POST \
--url https://billing.example.com/v1/subscriptions/{id}/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"hsn_code": "<string>"
}
'import requests
url = "https://billing.example.com/v1/subscriptions/{id}/charges"
payload = {
"amount": 123,
"currency": "<string>",
"description": "<string>",
"hsn_code": "<string>"
}
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({
amount: 123,
currency: '<string>',
description: '<string>',
hsn_code: '<string>'
})
};
fetch('https://billing.example.com/v1/subscriptions/{id}/charges', 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://billing.example.com/v1/subscriptions/{id}/charges",
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([
'amount' => 123,
'currency' => '<string>',
'description' => '<string>',
'hsn_code' => '<string>'
]),
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://billing.example.com/v1/subscriptions/{id}/charges"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"hsn_code\": \"<string>\"\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://billing.example.com/v1/subscriptions/{id}/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"hsn_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/subscriptions/{id}/charges")
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 \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"hsn_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"description": "<string>",
"hsn_code": "<string>",
"status": "pending",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}