curl -X GET "https://api.nevatal.com/api/v1/billing/invoices/6a4e954f3913cb6295ca98b6/pdf" \
-H "Authorization: Bearer nvtl_your_api_key" \
-o invoice.pdf
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="SETP990000123.pdf"
Content-Length: 87562
%PDF-1.4 ...
{
"success": false,
"error": "DIAN rejected this electronic invoice: it has no official graphical representation.",
"code": "INVOICE_PDF_NOT_AVAILABLE",
"correlationId": "req-2f1c",
"details": { "reason": "not_accepted" }
}
{
"success": false,
"error": "We could not get the official PDF from Alegra. Try again in a few minutes.",
"code": "PROVIDER_UNAVAILABLE",
"correlationId": "req-9a0b"
}
Billing
Download Invoice PDF
Download the PDF of a single issued invoice
GET
/
api
/
v1
/
billing
/
invoices
/
{id}
/
pdf
curl -X GET "https://api.nevatal.com/api/v1/billing/invoices/6a4e954f3913cb6295ca98b6/pdf" \
-H "Authorization: Bearer nvtl_your_api_key" \
-o invoice.pdf
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="SETP990000123.pdf"
Content-Length: 87562
%PDF-1.4 ...
{
"success": false,
"error": "DIAN rejected this electronic invoice: it has no official graphical representation.",
"code": "INVOICE_PDF_NOT_AVAILABLE",
"correlationId": "req-2f1c",
"details": { "reason": "not_accepted" }
}
{
"success": false,
"error": "We could not get the official PDF from Alegra. Try again in a few minutes.",
"code": "PROVIDER_UNAVAILABLE",
"correlationId": "req-9a0b"
}
Returns the PDF for one invoice, generated or fetched on demand. Nothing is
persisted — every download is produced fresh. Payer accounts (cuentas a
convenio) are invoices too: this same endpoint serves their PDF using their
own
A voided invoice (
id.
Which PDF each invoice gets
| Invoice kind | |
|---|---|
| Electronic (Alegra) | The provider’s official graphical representation, fetched on demand from Alegra and returned unmodified. |
| Electronic — external provider (FEV with CUFE only) | A Nevatal-generated PDF marked as an internal support copy, showing the CUFE. The official representation is issued by the external provider. |
| Manual | A Nevatal-generated PDF marked “Manual invoice — not an electronic sales invoice before DIAN”. |
| Payer account | Whichever of the above applies to its issuing provider. |
status: "voided") gets a “VOIDED” stamp on Nevatal-generated
PDFs (the official Alegra PDF is delivered untouched) and a -VOIDED suffix on
the file name in both cases.
Path Parameters
string
required
The invoice ID (also used for payer accounts)
Response
200 returns the PDF as application/pdf, with Content-Disposition: attachment
(file name derived from the invoice’s DIAN number when available, otherwise its
internal number) and Content-Length.
Every non-2xx response is the standard JSON error envelope, never binary.
boolean
Always
false on errorstring
Pre-localized message — display as-is
string
Machine-readable error code
string
Include when reporting an issue
string
Present on
INVOICE_PDF_NOT_AVAILABLE: one of not_accepted,
missing_provider_document, provider_file_not_availableErrors
| Status | Code | When |
|---|---|---|
401 | — | Missing or invalid token |
403 | — | Caller lacks BILLING:read |
404 | NOT_FOUND_ERROR | Invoice doesn’t exist, is deleted, or belongs to another clinic |
409 | INVOICE_PDF_DRAFT | The invoice is a draft — issue it first |
409 | INVOICE_PDF_NOT_AVAILABLE | No representation is available; see details.reason above |
503 | PROVIDER_UNAVAILABLE | Alegra did not respond (outage, timeout, or rejected credential) — retry later |
curl -X GET "https://api.nevatal.com/api/v1/billing/invoices/6a4e954f3913cb6295ca98b6/pdf" \
-H "Authorization: Bearer nvtl_your_api_key" \
-o invoice.pdf
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="SETP990000123.pdf"
Content-Length: 87562
%PDF-1.4 ...
{
"success": false,
"error": "DIAN rejected this electronic invoice: it has no official graphical representation.",
"code": "INVOICE_PDF_NOT_AVAILABLE",
"correlationId": "req-2f1c",
"details": { "reason": "not_accepted" }
}
{
"success": false,
"error": "We could not get the official PDF from Alegra. Try again in a few minutes.",
"code": "PROVIDER_UNAVAILABLE",
"correlationId": "req-9a0b"
}

