Fastly Billing API to Invoices API — when and how should I migrate?
Update cost-export and finance automation after Fastly removed the Billing API and replaced it with the Invoices API.
Blockers
- package/billing-api — EOL 2025-01-21
- Fastly states the Billing API was replaced by the Invoices API.
- By March 4, 2025, Fastly stated billing/v2 endpoints were being retired and switching to v3 endpoints was required.
- package/usage-metrics-api incompatible with package/invoices-api
Who this is for
- cost-sensitive
- enterprise
Candidates
Migrate finance exports to the Invoices API for invoiced accounts
As of 2026-04-04, Fastly's January 21, 2025 removal of the Billing API has already occurred, and Fastly states it was replaced by the Invoices API. The current supported invoice endpoints are under billing/v3, including list invoices, get invoice by ID, and get month-to-date invoice. The Invoices API returns finance-oriented fields such as invoice_id, invoice_posted_on, monthly_transaction_amount, currency_code, and transaction_line_items with amount, rate, units, usage_type, region, and product classifications. Fastly does not publish separate API-call pricing for this API in the referenced docs, so check official docs or your contract for billing terms.
When to choose
Use this when your organization receives Fastly invoices and your automation needs posted invoices, month-to-date invoice views, or line-item exports that align with accounting workflows. This is the default replacement for any legacy Billing API integration serving AP, finance reconciliation, or contract billing analysis.
Tradeoffs
Best match for invoice-backed finance systems and preserves billed line-item detail. Tradeoff is that it is invoice-centric rather than raw operational usage telemetry, so it is not the best source for near-real-time spend estimation.
Cautions
Do not keep calling legacy billing endpoints: Fastly says the Billing API is no longer available, and by March 4, 2025 Fastly also stated that billing/v2 endpoints were being retired and switching to v3 endpoints was required. Update endpoint paths, pagination handling, and downstream schemas for invoice line items before rerunning exports.
Use the Usage Metrics API only for non-invoiced accounts or operational usage workflows
As of 2026-04-04, Fastly documents a separate Usage Metrics API under billing/v3 for billing usage metrics. Fastly explicitly notes that customers who receive invoices should use the Invoices API instead, and only customers who do not receive invoices should use the Usage Metrics API. The Usage Metrics API exposes monthly and service-level usage metrics, including product_id, usage_type, quantity, raw_quantity, region, and last_updated_at. Fastly documents a hard limitation that usage-metrics returns data for a maximum period of three months at a time, and Fastly does not publish separate API pricing for this endpoint in the referenced docs.
When to choose
Use this when the account does not receive Fastly invoices or when you need operational usage metrics rather than posted invoice records. It is the better fit for internal dashboards, short-horizon cost estimation, or service-level usage analysis where invoice records are unavailable.
Tradeoffs
Gives usage-oriented data and service-level metrics that can support forecasting or engineering dashboards. Tradeoff is that Fastly says invoiced customers should use the Invoices API instead, and the three-month maximum query window makes it a poor long-term accounting export source.
Cautions
Do not treat this as a drop-in replacement for invoice exports on invoiced accounts. The documented audience, retention window, and data shape differ from the Invoices API, so finance systems may need separate ingestion logic or should avoid this path entirely.
Try with your AI agent
$ npm install -g pocketlantern $ pocketlantern init # Restart Claude Code, Cursor, or your MCP client, then ask: # "Fastly Billing API to Invoices API — when and how should I migrate?"