Supported endpoints
The currently supported endpoints are:/v1/subscriptions/<subscription_id>/usage/v1/subscriptions/<subscription_id>/costs/v1/customers/<customer_id>/costs/v1/customers/external_customer_id/<external_customer_id>/costs/v1/customers/<customer_id>/credits/v1/customers/external_customer_id/<external_customer_id>/credits/v1/customers/<customer_id>/credits/ledger/v1/customers/external_customer_id/<external_customer_id>/credits/ledger/v1/invoices/upcoming/v1/invoices/<invoice_id>
Performance benefits are only expected on invoices with
status = "draft",
since issued invoices already have frozen data.Header semantics
Orb currently supports two approaches for requesting cached data.Always fetching cached data
In order to opt-in to cached data, explicitly pass the following case-sensitive header:Fetch cached data conditional on a staleness threshold
In order to conditionally opt-in to cached data based on a maximum staleness age, pass the following headers:
The staleness of the cache is determined based on Orb’s invalidation based architecture, which tracks any potentially material changes to an Orb customer. Material changes include (but are not limited to) events ingested, subscription lifecycle changes, and prepurchase balance adjustments. Upon receiving an invalidating event, Orb marks a customer as invalid and schedules processing in the near future to rehydrate the cache.
Response headers
OnHTTP 200 responses when the Orb-Cache-Control header is passed with or without Orb-Cache-Max-Age-Seconds, the response will return the following
header:
In “always fetch cached” scenarios, we recommend using the
Orb-Cache-Updated-At value to determine if a follow-up request is necessary. If a specific result is completely up to date (based on internal event ingestion invalidation markers), Orb will set this value to the current time.