curl -X GET "https://api.contazen.ro/v1/expenses/exp_abc123/efactura-pdf" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o efactura.pdf
const expenseId = 'exp_abc123';
const response = await fetch(`https://api.contazen.ro/v1/expenses/${expenseId}/efactura-pdf`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const blob = await response.blob();
$expenseId = 'exp_abc123';
$ch = curl_init("https://api.contazen.ro/v1/expenses/{$expenseId}/efactura-pdf");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$pdf = curl_exec($ch);
curl_close($ch);
file_put_contents('efactura.pdf', $pdf);
"<string>"{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}Expenses
Download e-Factura PDF
Stream the ANAF e-Factura PDF for an expense imported from the SPV inbox
GET
/
expenses
/
{id}
/
efactura-pdf
curl -X GET "https://api.contazen.ro/v1/expenses/exp_abc123/efactura-pdf" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o efactura.pdf
const expenseId = 'exp_abc123';
const response = await fetch(`https://api.contazen.ro/v1/expenses/${expenseId}/efactura-pdf`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const blob = await response.blob();
$expenseId = 'exp_abc123';
$ch = curl_init("https://api.contazen.ro/v1/expenses/{$expenseId}/efactura-pdf");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$pdf = curl_exec($ch);
curl_close($ch);
file_put_contents('efactura.pdf', $pdf);
"<string>"{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}Overview
Returns the e-Factura PDF for an expense that was imported from the ANAF e-Factura SPV inbox. The PDF is rendered on demand via the ANAF public validator the first time it is requested and cached on disk for subsequent calls. This endpoint requires the same Bearer authentication as the rest of the API. Use theefactura.pdf_url field from Retrieve Expense
to discover the URL — it is only present when efactura.xml_available is
true.
Path Parameters
string
required
The CzUid of the expense
Response
Returnsapplication/pdf binary content with Content-Disposition: inline.
Error Responses
Returned when the expense was not imported from SPV (
efactura_not_available)
or its XML file is missing on disk (efactura_xml_missing).The ANAF validator failed to convert the XML to PDF (
efactura_pdf_generation_failed).curl -X GET "https://api.contazen.ro/v1/expenses/exp_abc123/efactura-pdf" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o efactura.pdf
const expenseId = 'exp_abc123';
const response = await fetch(`https://api.contazen.ro/v1/expenses/${expenseId}/efactura-pdf`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const blob = await response.blob();
$expenseId = 'exp_abc123';
$ch = curl_init("https://api.contazen.ro/v1/expenses/{$expenseId}/efactura-pdf");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$pdf = curl_exec($ch);
curl_close($ch);
file_put_contents('efactura.pdf', $pdf);
Was this page helpful?