E-Invoice
Retry E-Invoice
Retry submission of a failed e-invoice to the IRP portal.
POST
/
v1
/
invoices
/
{id}
/
einvoice
/
retry
Retry e-invoice generation
curl --request POST \
--url https://billing.example.com/v1/invoices/{id}/einvoice/retry \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices/{id}/einvoice/retry"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/invoices/{id}/einvoice/retry', 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/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/retry"
req, _ := http.NewRequest("POST", 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.post("https://billing.example.com/v1/invoices/{id}/einvoice/retry")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices/{id}/einvoice/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {},
"message": "<string>"
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the invoice (e.g., inv_Rp3mK7nBwQ). |
Example Request
curl -X POST https://api.recurso.dev/v1/invoices/inv_Rp3mK7nBwQ/einvoice/retry \
-H "Authorization: Bearer rsk_live_7f3a9b2c1d4e8f0a"
Response
{
"data": {
"id": "einv_Ys5tH2xLmN",
"invoice_id": "inv_Rp3mK7nBwQ",
"irn": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
"ack_number": "232610039178645",
"ack_date": "2026-06-23T15:45:12Z",
"status": "generated",
"signed_qr_code": "eyJhbGciOiJSUzI1NiIsInR5cCI6Ikp...",
"signed_invoice": "MIIG7DCCBNSgAwIBAgIQBOe...",
"previous_attempts": 2,
"last_error": null,
"created_at": "2026-06-22T10:30:00Z",
"updated_at": "2026-06-23T15:45:12Z"
},
"message": "E-invoice retry initiated"
}
Notes
- This endpoint can only be called on invoices where the previous e-invoice submission failed. Invoices with an active e-invoice will return a
409 Conflicterror. - The retry uses the current invoice data. If the invoice details have been corrected since the last failure, the updated data is sent.
- The
previous_attemptscounter is incremented with each retry. - If the IRP is temporarily unavailable, the submission is queued and processed when connectivity is restored.
E-invoice generation is irreversible once acknowledged by the IRP. Ensure the invoice data is correct before retrying.
Check the
last_error field on a failed e-invoice to understand why the previous attempt failed before retrying.⌘I
Retry e-invoice generation
curl --request POST \
--url https://billing.example.com/v1/invoices/{id}/einvoice/retry \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/invoices/{id}/einvoice/retry"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/invoices/{id}/einvoice/retry', 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/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/retry"
req, _ := http.NewRequest("POST", 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.post("https://billing.example.com/v1/invoices/{id}/einvoice/retry")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/invoices/{id}/einvoice/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {},
"message": "<string>"
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}