GET
/
subscriptions
/
{subscription_id}
/
usage
curl --request GET \
  --url https://api.withorb.com/v1/subscriptions/{subscription_id}/usage \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "usage": [
        {
          "quantity": 123,
          "timeframe_start": "2023-11-07T05:31:56Z",
          "timeframe_end": "2023-11-07T05:31:56Z"
        }
      ],
      "billable_metric": {
        "id": "<string>",
        "name": "<string>"
      },
      "view_mode": "periodic"
    }
  ]
}

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Path Parameters

subscription_id
string
required

Query Parameters

granularity
enum<string> | null
default:
day

This determines the windowing of usage reporting.

Available options:
day
timeframe_start
string | null

Usage returned is inclusive of timeframe_start.

timeframe_end
string | null

Usage returned is exclusive of timeframe_end.

billable_metric_id
string | null

When specified in conjunction with group_by, this parameter filters usage to a single billable metric. Note that both group_by and billable_metric_id must be specified together.

group_by
string | null

Groups per-price usage by the key provided.

view_mode
enum<string> | null

Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior.

Available options:
periodic,
cumulative
first_dimension_key
string | null
first_dimension_value
string | null
second_dimension_key
string | null
second_dimension_value
string | null

Response

200
application/json
OK
data
object[]
required