Invoices
Get Invoice
Retrieve a single invoice by id
GET
/
v1
/
invoices
/
{id}
Get an invoice by id
curl --request GET \
--url https://billing.example.com/v1/invoices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices/{id}")
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": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}One invoice, scoped to the authenticated tenant. A foreign or missing id
returns a flat
See Errors for the error envelope and the full code taxonomy.
404 — existence is never confirmed across tenants.
Example Request
curl "https://api.recurso.dev/v1/invoices/inv_abc123" \
-H "Authorization: Bearer $API_KEY"
Response
{
"data": {
"id": "inv_abc123",
"invoice_number": "REC/2026/0042",
"customer_id": "cust_abc123",
"subscription_id": "sub_def456",
"status": "open",
"currency": "USD",
"subtotal": 29900,
"tax_amount": 0,
"total": 29900,
"amount_paid": 0,
"amount_due": 29900,
"due_date": "2026-09-11T00:00:00Z",
"line_items": [
{ "description": "Scale subscription", "quantity": 1, "amount": 29900 }
]
}
}
Errors
| Status | Code | When | Fix |
|---|---|---|---|
| 400 | validation_failed | id is not a valid UUID. | Pass the invoice’s UUID. |
| 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. |
| 404 | not_found | No invoice with that ID exists in your tenant (IDs from another tenant also return 404). | Check the ID, and that the key belongs to the tenant that owns the invoice. |
⌘I
Get an invoice by id
curl --request GET \
--url https://billing.example.com/v1/invoices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices/{id}")
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": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}