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's line items as CSV

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

Streams a CSV export of the referenced invoice's line items — the synchronous CSV twin of the PDF GET .../download: one row per line item (carrying the invoice number/period/status) plus Subtotal / Tax / Credits applied / Total footer rows. Unlike the PDF, a CANCELLED invoice still exports — this is a data export, not a legal document. The download does not mutate the invoice. Validation: invoiceId must reference an invoice visible in the active scope (otherwise 404 NOT_FOUND); the caller must hold billing read access in the scope (otherwise 403 FORBIDDEN). Async & state: Synchronous read; no state change. The CSV is rebuilt from the frozen invoice and streamed inline; no Operation is created and no resource.updated SSE frames are emitted. Errors: 401 unauthenticated; 403 caller lacks billing read permission in the scope; 404 unknown invoiceId in the scope; 500 internal failure. Idempotency/Concurrency: Safe, cacheable; no idempotency key required. Repeated downloads return byte-identical CSVs for a finalized (frozen) 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 whose line items are downloaded.

Response Body

CSV export of the invoice's line items plus totals footer.

response?unknowntext/csv
curl -X GET "https://example.com/scopes/string/billing/invoices/string/exports/download"
null