Download purchase invoice PDF
Downloads the purchase invoice as a PDF file.
GET /api/purchase-invoices/{id}/download-pdfPath parameters
Response
Status code: 200 OK
Response headers:
Content-Type: application/pdfContent-Disposition: attachment; filename="INV-2024-001.pdf"
Response body:
Returns the PDF file data in bytes.
PDF download is allowed when meta_info.peppol_status.overall_status is APPROVED, or when the document is simplified (transaction_type bit 1 is 1). Other Peppol statuses (PENDING, REJECTED, VALIDATION_FAILED) return 400.
Error responses
400 Bad Request
PDF is not allowed for this Peppol status.
{
"errors": {
"document_status": "PDF download is only allowed for documents with APPROVED status."
}
}401 Unauthorized
Authentication required or invalid token.
{
"errors": {
"message": "Authentication required or invalid token"
}
}403 Forbidden
User not authorized to access this purchase invoice.
{
"errors": {
"message": "Not authorized to perform this operation"
}
}404 Not Found
Purchase invoice not found.
{
"errors": {
"message": "Purchase invoice not found"
}
}500 Internal Server Error
An error occurred while processing the request.
{
"errors": {
"message": "An error occurred"
}
}