Credit Notes
List Credit Notes
Retrieve a list of credit notes
GET
/
v1
/
credit-notes
List credit notes
curl --request GET \
--url https://billing.example.com/v1/credit-notes \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/credit-notes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/credit-notes', 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/credit-notes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://billing.example.com/v1/credit-notes"
req, _ := http.NewRequest("GET", 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.get("https://billing.example.com/v1/credit-notes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/credit-notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "<string>",
"amount": 123,
"subtotal": 123,
"tax_amount": 123,
"igst_amount": 123,
"cgst_amount": 123,
"sgst_amount": 123,
"tax_type": "<string>",
"hsn_code": "<string>",
"balance": 123,
"currency": "<string>",
"status": "issued",
"reason": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"tax_id": "<string>",
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"ledger_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gstin": "<string>",
"tax_type": "<string>",
"place_of_supply": "<string>",
"tax_exempt": true,
"tax_exemption_number": "<string>",
"tax_exemption_code": "<string>",
"tax_exemption_expires_at": "2023-12-25",
"referral_code": "<string>",
"risk_score": 50,
"risk_factors": {},
"card_brand": "<string>",
"card_last4": "<string>",
"card_exp_month": 123,
"card_exp_year": 123,
"card_token_id": "<string>",
"card_fingerprint": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}
]
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Query Parameters
| Parameter | Type | Description |
|---|---|---|
customer_id | string | Filter by customer |
invoice_id | string | Filter by invoice |
limit | integer | Max results (default: 1000, capped at 1000) |
offset | integer | Pagination offset |
Example Request
curl "https://api.recurso.dev/v1/credit-notes?customer_id=cust_abc123&limit=10" \
-H "Authorization: Bearer $API_KEY"
Response
{
"object": "list",
"data": [
{
"id": "cn_r4t8w1",
"object": "credit_note",
"invoice_id": "inv_001",
"customer_id": "cust_abc123",
"status": "issued",
"currency": "INR",
"amount": 2500,
"amount_remaining": 2500,
"reason": "Service downtime on 2024-03-12",
"credit_note_number": "REC-CN/2024/0012",
"created_at": "2024-03-15T11:00:00Z"
},
{
"id": "cn_p2v6k9",
"object": "credit_note",
"invoice_id": "inv_003",
"customer_id": "cust_abc123",
"status": "applied",
"currency": "INR",
"amount": 1000,
"amount_remaining": 0,
"reason": "Billing adjustment",
"credit_note_number": "REC-CN/2024/0008",
"created_at": "2024-02-20T09:30:00Z"
}
],
"has_more": false,
"total_count": 2
}
Errors
| Status | Code | When | Fix |
|---|---|---|---|
401 | unauthorized | Missing or invalid API key / session | Send Authorization: Bearer $API_KEY |
500 | internal_error | Unexpected server failure | Retry; contact support if it persists |
customer_id filter is ignored rather than rejected. Errors use
the standard envelope — see Errors.Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Query Parameters
Max rows returned (clamped to 1000).
Required range:
x <= 1000Rows to skip, for paging past the clamp.
Required range:
x >= 0Filter by customer.
Response
Credit notes for the tenant.
Show child attributes
Show child attributes
⌘I
List credit notes
curl --request GET \
--url https://billing.example.com/v1/credit-notes \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/credit-notes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/credit-notes', 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/credit-notes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://billing.example.com/v1/credit-notes"
req, _ := http.NewRequest("GET", 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.get("https://billing.example.com/v1/credit-notes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/credit-notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "<string>",
"amount": 123,
"subtotal": 123,
"tax_amount": 123,
"igst_amount": 123,
"cgst_amount": 123,
"sgst_amount": 123,
"tax_type": "<string>",
"hsn_code": "<string>",
"balance": 123,
"currency": "<string>",
"status": "issued",
"reason": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"tax_id": "<string>",
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"ledger_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gstin": "<string>",
"tax_type": "<string>",
"place_of_supply": "<string>",
"tax_exempt": true,
"tax_exemption_number": "<string>",
"tax_exemption_code": "<string>",
"tax_exemption_expires_at": "2023-12-25",
"referral_code": "<string>",
"risk_score": 50,
"risk_factors": {},
"card_brand": "<string>",
"card_last4": "<string>",
"card_exp_month": 123,
"card_exp_year": 123,
"card_token_id": "<string>",
"card_fingerprint": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}
]
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}