App Logo
admin.atlassian.com

Download an Atlassian invoice PDF

Download one Atlassian (admin.atlassian.com) billing invoice, given the downloadUrl — or the id plus transaction_account — that admin.atlassian.com/list_invoices returns. Returns the real filename plus the PDF bytes as base64 (decode and write it yourself). The bytes come back with the run, so it does not depend on the browser's own download folder, and it still works when Atlassian serves the PDF from a signed storage location. Only an org billing admin can download invoices.

Input

id optional

Atlassian invoice id from admin.atlassian.com/list_invoices. Used only when downloadUrl is not given, and then transaction_account is required too.

number optional

The 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 optional

The invoice's downloadUrl exactly as returned by admin.atlassian.com/list_invoices. Preferred over id/transaction_account.

sourceSystem optional

Which billing system issued the invoice, from the list row. Only used when building the URL from id.

Default: "CCP"
transaction_account optional

The invoice's transaction_account from the list row. Required when using id instead of downloadUrl.

Output

filename required

The real suggested filename from the file's Content-Disposition, falling back to Atlassian-<id>.pdf.

pdf_base64 required

The PDF bytes, base64-encoded. Decode and write it yourself — the script is sandboxed and cannot write to disk.

via optional

Which 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 optional

Byte length of the decoded PDF.

Start building not clicking