Download a Slack invoice PDF
Input
billId optionalA bill ID from slack.com/list_invoices, used only when pdfUrl is not given. Combined with workspaceDomain to build the URL.
pdfUrl optionalThe statement's download URL as returned by slack.com/list_invoices (https://<workspace>.slack.com/admin/billing/<billId>/pdf). Preferred over billId.
workspaceDomain optionalWorkspace host to target when using billId, e.g. acme.slack.com. Defaults to my.slack.com (primary workspace). Ignored when pdfUrl is given.
Output
filename requiredThe real suggested filename, taken from the file's Content-Disposition (e.g. Slack-Statement-SBIE-10873175.pdf). Falls back to Slack-<billId>.<ext> if Slack sends no Content-Disposition.
pdf_base64 requiredThe file bytes, base64-encoded. Decode and write it yourself — the script is sandboxed and cannot write to disk.
size_bytes optionalByte length of the decoded file.
content_type optionalThe file's own MIME type. Normally application/pdf; Slack answers application/zip for a bundled statement, in which case pdf_base64 holds zip bytes and filename ends in .zip.
