Invoices
List Invoices
Retrieve a list of invoices
GET
/
v1
/
invoices
List invoices
curl --request GET \
--url https://billing.example.com/v1/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices"
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/invoices', 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/invoices",
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/invoices"
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/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices")
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",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"billing_reason": "<string>",
"amount_due": 123,
"amount_paid": 123,
"currency": "<string>",
"subtotal": 123,
"tax_amount": 123,
"total": 123,
"tax_regime": "gst",
"igst_amount": 123,
"cgst_amount": 123,
"sgst_amount": 123,
"hsn_code": "<string>",
"irn": "<string>",
"ack_no": "<string>",
"signed_qr_code": "<string>",
"e_invoice_status": "<string>",
"ack_date": "<string>",
"e_invoice_retry_count": 123,
"e_invoice_next_retry_at": "2023-11-07T05:31:56Z",
"e_invoice_error_message": "<string>",
"tds_amount": 123,
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"payment_terms": "<string>",
"exchange_rate": 123,
"base_currency_total": 123,
"base_currency": "<string>",
"next_retry_at": "2023-11-07T05:31:56Z",
"retry_count": 123,
"payment_wall_active": true,
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"hsn_code": "<string>",
"quantity": 123,
"unit_amount": 123,
"amount": 123,
"tax_rate": 123,
"cgst_amount": 123,
"sgst_amount": 123,
"igst_amount": 123,
"taxable_amount": 123,
"created_at": "2023-11-07T05:31:56Z"
}
]
}
]
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Query Parameters
| Parameter | Type | Description |
|---|---|---|
customer_id | uuid | Filter to one customer’s invoices (tenant-scoped) |
subscription_id | uuid | Filter to one subscription’s invoices. Ignored when customer_id is also set |
page | integer | Page number (default: 1) |
per_page | integer | Rows per page (default: 50, capped at 250) |
Example Request
curl "https://api.recurso.dev/v1/invoices?customer_id=cust_abc&status=open" \
-H "Authorization: Bearer $API_KEY"
Response
{
"object": "list",
"data": [
{
"id": "inv_001",
"object": "invoice",
"invoice_number": "REC/2024/0001",
"customer_id": "cust_abc123",
"status": "open",
"currency": "INR",
"total": 5899,
"amount_due": 5899,
"due_date": "2024-01-30T00:00:00Z"
}
],
"has_more": false,
"total_count": 1
}
Errors
| Status | Code | When | Fix |
|---|---|---|---|
| 400 | validation_failed | A customer_id or subscription_id filter is not a valid UUID. | Pass UUIDs in the filter query parameters. |
| 401 | unauthorized | API key missing or invalid (invalid_api_key), or a live/test mode mismatch (key_mode_mismatch). | Send Authorization: Bearer <api_key> with a key for the right mode. |
| 500 | internal_error | The list query failed server-side. | Retry; if it persists, contact support with the request timestamp. |
Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Query Parameters
Filter to one customer's invoices (tenant-scoped; a foreign customer id yields an empty page).
Filter to one subscription's invoices (tenant-scoped). Ignored when customer_id is also provided.
Response
Invoices for the tenant.
Show child attributes
Show child attributes
⌘I
List invoices
curl --request GET \
--url https://billing.example.com/v1/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices"
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/invoices', 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/invoices",
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/invoices"
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/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices")
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",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"billing_reason": "<string>",
"amount_due": 123,
"amount_paid": 123,
"currency": "<string>",
"subtotal": 123,
"tax_amount": 123,
"total": 123,
"tax_regime": "gst",
"igst_amount": 123,
"cgst_amount": 123,
"sgst_amount": 123,
"hsn_code": "<string>",
"irn": "<string>",
"ack_no": "<string>",
"signed_qr_code": "<string>",
"e_invoice_status": "<string>",
"ack_date": "<string>",
"e_invoice_retry_count": 123,
"e_invoice_next_retry_at": "2023-11-07T05:31:56Z",
"e_invoice_error_message": "<string>",
"tds_amount": 123,
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"payment_terms": "<string>",
"exchange_rate": 123,
"base_currency_total": 123,
"base_currency": "<string>",
"next_retry_at": "2023-11-07T05:31:56Z",
"retry_count": 123,
"payment_wall_active": true,
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"hsn_code": "<string>",
"quantity": 123,
"unit_amount": 123,
"amount": 123,
"tax_rate": 123,
"cgst_amount": 123,
"sgst_amount": 123,
"igst_amount": 123,
"taxable_amount": 123,
"created_at": "2023-11-07T05:31:56Z"
}
]
}
]
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}