Download an Atlassian invoice PDF
Input
id optionalAtlassian invoice id from admin.atlassian.com/list_invoices. Used only when downloadUrl is not given, and then transaction_account is required too.
number optionalThe invoice's number from the list row (e.g. IN-EU-002-392-813). Optional, and only used to name the file: Atlassian's download endpoint sends no Content-Disposition, so without this the filename falls back to the opaque invoice id.
downloadUrl optionalThe invoice's downloadUrl exactly as returned by admin.atlassian.com/list_invoices. Preferred over id/transaction_account.
sourceSystem optionalWhich billing system issued the invoice, from the list row. Only used when building the URL from id.
Default: "CCP"transaction_account optionalThe invoice's transaction_account from the list row. Required when using id instead of downloadUrl.
Output
filename requiredThe real suggested filename from the file's Content-Disposition, falling back to Atlassian-<id>.pdf.
pdf_base64 requiredThe PDF bytes, base64-encoded. Decode and write it yourself — the script is sandboxed and cannot write to disk.
via optionalWhich route produced the bytes: a direct same-origin fetch of the billing endpoint, or a second fetch after landing on the storage host Atlassian redirected the file to. Diagnostic only.
size_bytes optionalByte length of the decoded PDF.
