Billing & FinOps

Preview — pending review

This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.

Download the invoice document (PDF)

GET
/scopes/{scopeId}/billing/invoices/{invoiceId}/download

Streams the rendered invoice document for the given invoice ("Download PDF" on the invoice detail page and the per-row "Download invoice" action in the Invoices page). The document reflects the invoice's current persisted state (number, period, totals, status); the invoice itself is never mutated by the download. The UI disables the action for CANCELLED invoices ("Cancelled — no PDF"), and the backend mirrors that rule. Validation: invoiceId must reference an invoice visible in the active scope (otherwise 404 NOT_FOUND); the invoice status must permit download — CANCELLED invoices have no document and are rejected with 409 CONFLICT; the caller must hold billing read access in the scope (otherwise 403 FORBIDDEN). Async & state: Synchronous read returning the file stream; no state change and no SSE frames. Document rendering is performed (or served from cache) inline within the request. Errors: 401 unauthenticated; 403 caller lacks billing read access; 404 unknown invoiceId in the scope; 409 invoice is CANCELLED and has no downloadable document; 500 on render/stream failure. Idempotency/Concurrency: Safe, cacheable; no idempotency key required. Repeated downloads return byte-identical documents for an unchanged invoice.

Authorization

bearerToken
headerAuthorizationBearer <token>

An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.

Path Parameters

scopeId*string

Opaque ownership+authorization scope resolving to tenant + subscription + project.

invoiceId*string

Identifier of the invoice to download.

Response Body

Invoice document stream (PDF attachment named after the invoice number).

response?unknownapplication/pdf
curl -X GET "https://example.com/scopes/string/billing/invoices/string/download"
null