Download a document's XML

get
https://api.wafeq.com/ae/v1/invoices/{invoice_id}/xml

Download the XML of a document, the e-invoice itself, by its document_id (the invoice_id in the path).

Usually answers 302, with Location set to a download link that expires after
15 minutes. A queued document that hasn't been prepared for delivery yet comes back
directly instead (200, application/xml). A document Wafeq delivered over Peppol
can come wrapped in the Peppol message envelope (StandardBusinessDocument), with
the e-invoice inside.

For a received document, the first download within 2 minutes of its reception
lets Wafeq e-invoicing ASP tell the sender's provider
that the document reached the buyer (MLS AP). Without it, the sender gets
forwarded (MLS AB). Only a download by an organization with an inbound:read
grant from the buyer counts as that confirmation. A later download changes nothing.

Works for invoices and credit notes, and stays available after the taxpayer is
deregistered: the document is a record it must be able to produce long after it
stops issuing.

Path Params
stringrequired
Headers
string | null
stringrequired

Taxpayer ID (txpay_…). Required with an organization API key (pk_…) for this taxpayer-specific operation, even for one taxpayer. Not a TIN. Optional with a taxpayer access token, which already names its taxpayer.

string | null

Grant ID (tgr_…) to act through, with an organization API key. The request then has exactly that grant's scopes and fails once the grant is revoked. Without it, the key acts through all of the organization's active grants on the taxpayer.

Response