Skip to navigation

Download e-invoices (XML or STAR JSON)

View as Markdown

Download one or more e-invoices in the format you choose:

docTypedata returned
XMLThe Peppol PINT-SG UBL XML (wrapped in its SBDH envelope), as a string — the XML that was sent, or that was received over Peppol.
STAR_JSONThe e-invoice as a STAR JSON object — the same format used to submit e-invoices. For received e-invoices it is mapped from the received XML.

Supported countries: sg (Singapore). The country code is case-insensitive.

Limit: 1–100 docIds per request. Duplicate ids are returned once.

Each document is returned with its current status, whatever state it is in. Documents that cannot be returned are listed in unresolved with a reason, and the rest of the request still succeeds:

errorMeaning
INVALID_DOCUMENT_IDThe id is not a positive integer.
DOCUMENT_NOT_FOUNDNo document with this id exists in your organisation.
NOT_AN_EINVOICEThe document exists but is not an e-invoice for this country.
XML_NOT_AVAILABLEThe document has no XML (docType: XML).
STAR_JSON_NOT_AVAILABLEThe document has no STAR JSON (docType: STAR_JSON).

Access is all-or-nothing: if any requested document belongs to a queue you are not assigned to, nothing is returned and the call fails with 403 listing those docIds.

Authentication

x-api-keystring
API key issued by Staple.
AuthorizationBearer
JWT obtained from the login endpoint.

Path parameters

countryCodeenumRequired

Country of the e-invoices. Supported: sg.

Allowed values:

Request

This endpoint expects an object.
docTypeenumRequired

Format to return. Case-sensitive.

Allowed values:
docIdslist of integersRequired

Internal document IDs (1–100). Numeric strings are also accepted.

Response

The documents that could be returned, plus unresolved for the rest.

documentslist of objectsOptional
unresolvedlist of objectsOptional