Invoices
Get E-Invoice Status
Retrieve the e-invoice status for an invoice
GET
/
v1
/
invoices
/
{id}
/
einvoice
Get e-invoice (IRN) status
curl --request GET \
--url https://billing.example.com/v1/invoices/{id}/einvoice \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices/{id}/einvoice"
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}/einvoice', 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}/einvoice",
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}/einvoice"
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}/einvoice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices/{id}/einvoice")
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": {
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"e_invoice_status": "<string>",
"irn": "<string>",
"ack_no": "<string>",
"ack_date": "<string>",
"signed_qr_code": "<string>",
"retry_count": 123,
"next_retry_at": "2023-11-07T05:31:56Z",
"error_message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The invoice ID |
Example Request
curl https://api.recurso.dev/v1/invoices/inv_001/einvoice \
-H "Authorization: Bearer $API_KEY"
Response
{
"id": "einv_8mw3p1",
"object": "einvoice",
"invoice_id": "inv_001",
"status": "generated",
"irn": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
"ack_number": "112310037956284",
"ack_date": "2024-01-15T12:30:00Z",
"signed_qr_code": "eyJhbGciOiJSUzI1NiIsInR5cCI6...",
"error": null,
"created_at": "2024-01-15T12:00:00Z",
"updated_at": "2024-01-15T12:30:00Z"
}
E-invoicing is required for businesses in India with turnover above the threshold set by GST regulations. The
irn (Invoice Reference Number) is a unique identifier issued by the government e-invoice portal.Status Values
| Status | Description |
|---|---|
pending | E-invoice generation has been queued |
generated | IRN successfully obtained from the portal |
failed | Generation failed — check the error field |
canceled | E-invoice has been canceled |
⌘I
Get e-invoice (IRN) status
curl --request GET \
--url https://billing.example.com/v1/invoices/{id}/einvoice \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices/{id}/einvoice"
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}/einvoice', 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}/einvoice",
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}/einvoice"
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}/einvoice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices/{id}/einvoice")
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": {
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"e_invoice_status": "<string>",
"irn": "<string>",
"ack_no": "<string>",
"ack_date": "<string>",
"signed_qr_code": "<string>",
"retry_count": 123,
"next_retry_at": "2023-11-07T05:31:56Z",
"error_message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}