Download Document
Retrieves the document content associated with the provided documentId from the connected e-invoicing provider.
A document_id by itself is not always sufficient for the provider to determine which document formats or variants to return. Chargebee includes additional query parameters — such as country, transaction_type, and model — so the adapter can accurately identify and fetch the correct document representations.
If the mime_type query parameter is not provided, the adapter MUST retrieve all available document representations for the specified document_id. When a specific mime_type is supplied, the adapter MUST return only the matching representation(s).
The document may be returned either as a pre-signed URL or as a direct binary stream (such as a PDF or XML file), depending on the provider’s capabilities and the SPI implementation.
In Chargebee, this endpoint is called after the document has been successfully processed either to send it via email to the end customer or when the merchant initiates a download from the Chargebee UI.
Implementing this endpoint is MANDATORY to support document retrieval operations.
Documentation Index
Fetch the complete documentation index at: https://spidocs.chargebee.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Path Parameters
Query Parameters
Optional MIME type filter for the document representation to download.
When provided, the adapter MUST return only the document(s) matching this MIME type
(for example, application/xml, application/pdf, or a country-specific UBL MIME type).
When omitted, the adapter MUST attempt to retrieve and return all available representations for the given document_id from the underlying e-invoicing provider.
"application/xml"
The ISO 3166-1 alpha-2 country code representing the country for which the e-invoicing data input fields need to be retrieved. Different countries may have varying e-invoicing requirements.
"DE"
The transaction type for which the data input fields need to be retrieved. Required fields may vary depending on the type: B2B (Business to Business), B2C (Business to Consumer), or B2G (Business to Government).
B2B, B2C, B2G "B2B"
Indicates the eInvoicing flow model that governs the document exchange and processing mechanism. Different countries adopt different models based on legal, technical, and administrative mandates. Supported values:
- PEPPOL: A standardized, secure eInvoicing network enabling cross-border electronic document exchange between businesses and governments.
- EINVOICE: Traditional eInvoicing model where invoices are digitally exchanged between businesses and sometimes stored.
- CLEARANCE: Invoices must be pre-approved by a tax authority before they are sent to the buyer.
- REPORTING: Invoices are shared with tax authorities after issuance, usually for compliance and audit purposes.
- ZUGFERD: A hybrid eInvoicing format used in Germany combining PDF and XML for human and machine readability.
- CTC: Continuous Transaction Controls involve real-time or near-real-time invoice validation and transmission to tax authorities.
- NEMHANDEL: Denmark’s national infrastructure for eInvoicing that supports secure delivery via specific formats like OIOUBL.
- FACE: Spain’s centralized system (FACe/FACeB2B) for routing invoices to government or private recipients.
- VERIFACTU: Spain’s mechanism for validating and reporting sales invoices directly to the tax agency.
PEPPOL, EINVOICE, CLEARANCE, REPORTING, ZUGFERD, CTC, NEMHANDEL, FACE, VERIFACTU "PEPPOL"
Type of business document.
"ubl-invoice"
Response
Document downloaded successfully.
Indicates the eInvoicing flow model that governs the document exchange and processing mechanism. Different countries adopt different models based on legal, technical, and administrative mandates. Supported values:
- PEPPOL: A standardized, secure eInvoicing network enabling cross-border electronic document exchange between businesses and governments.
- EINVOICE: Traditional eInvoicing model where invoices are digitally exchanged between businesses and sometimes stored.
- CLEARANCE: Invoices must be pre-approved by a tax authority before they are sent to the buyer.
- REPORTING: Invoices are shared with tax authorities after issuance, usually for compliance and audit purposes.
- ZUGFERD: A hybrid eInvoicing format used in Germany combining PDF and XML for human and machine readability.
- CTC: Continuous Transaction Controls involve real-time or near-real-time invoice validation and transmission to tax authorities.
- NEMHANDEL: Denmark’s national infrastructure for eInvoicing that supports secure delivery via specific formats like OIOUBL.
- FACE: Spain’s centralized system (FACe/FACeB2B) for routing invoices to government or private recipients.
- VERIFACTU: Spain’s mechanism for validating and reporting sales invoices directly to the tax agency.
schema:
type: string
enum:
- PEPPOL
- EINVOICE
- CLEARANCE
- REPORTING
- ZUGFERD
- CTC
- NEMHANDEL
- FACE
- VERIFACTU example: "PEPPOL"