Portal
List Customer Invoices
List invoices for the authenticated customer in the portal
GET
/
portal
/
api
/
invoices
List the logged-in customer's invoices
curl --request GET \
--url https://billing.example.com/portal/api/invoices \
--cookie portal_session=import requests
url = "https://billing.example.com/portal/api/invoices"
headers = {"cookie": "portal_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'portal_session='}};
fetch('https://billing.example.com/portal/api/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/portal/api/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "portal_session=",
]);
$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/portal/api/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "portal_session=")
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/portal/api/invoices")
.header("cookie", "portal_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/portal/api/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'portal_session='
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>"
}
}Requires a valid portal session token obtained via magic link authentication.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: draft, open, paid, past_due, void |
limit | integer | Max results (default: 1000, capped at 1000) |
offset | integer | Pagination offset |
Example Request
curl "https://api.recurso.dev/portal/api/invoices?status=open&limit=10" \
-H "Authorization: Bearer sess_x9y8z7w6v5u4t3s2"
Response
{
"object": "list",
"data": [
{
"id": "inv_001",
"object": "invoice",
"invoice_number": "REC/2024/0001",
"status": "open",
"currency": "INR",
"total": 5899,
"amount_due": 5899,
"due_date": "2024-01-30T00:00:00Z",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "inv_002",
"object": "invoice",
"invoice_number": "REC/2024/0002",
"status": "paid",
"currency": "INR",
"total": 11999,
"amount_due": 0,
"due_date": "2024-02-15T00:00:00Z",
"created_at": "2024-02-01T00:00:00Z"
}
],
"has_more": false,
"total_count": 2
}
To let a customer pay an open invoice, link them to the hosted checkout page:
https://api.recurso.dev/checkout/{invoice_id}.⌘I
List the logged-in customer's invoices
curl --request GET \
--url https://billing.example.com/portal/api/invoices \
--cookie portal_session=import requests
url = "https://billing.example.com/portal/api/invoices"
headers = {"cookie": "portal_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'portal_session='}};
fetch('https://billing.example.com/portal/api/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/portal/api/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "portal_session=",
]);
$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/portal/api/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "portal_session=")
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/portal/api/invoices")
.header("cookie", "portal_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/portal/api/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'portal_session='
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>"
}
}