Pandabase
Store APIsSubscriptions

Get subscription usage

GET
/stores/{storeId}/subscriptions/{subscriptionId}/usage

Returns a live projection of the current billing period together with summaries of past periods for the subscription. Non-usage subscriptions return isUsageBased: false. Requires the USAGE_READ scope.

Authorization

AuthorizationBearer <token>

Bearer token authentication. Pass the secret directly in the Authorization header. Token secrets start with sk_.

In: header

Path Parameters

storeId*string
Length12 <= length <= 48
subscriptionId*string
Length12 <= length <= 48

Header Parameters

idempotency-key?string
Length8 <= length <= 32

Response Body

application/json

application/json

curl -X GET "https://example.com/stores/stringstring/subscriptions/stringstring/usage"
{  "ok": true,  "data": {    "subscriptionId": "sub_8h4t6sqzy3x9w5n2k1m0vqbf",    "isUsageBased": true,    "currency": "USD",    "currentPeriod": {      "periodStart": "2026-05-01T00:00:00.000Z",      "periodEnd": "2026-06-01T00:00:00.000Z",      "baseAmount": 0,      "usageAmount": 1970,      "projectedTotal": 1970,      "meters": [        {          "meterId": "umt_5e1q3npwt0u6s2k8h9j7rzbc",          "eventName": "input_tokens",          "quantity": 6566667,          "amountCharged": 1970        }      ]    },    "pastPeriods": [      {        "periodStart": "2026-04-01T00:00:00.000Z",        "periodEnd": "2026-05-01T00:00:00.000Z",        "totalCharged": 4500,        "orderId": "ord_p2v8q1mzj0kxw5h7n4tr3bcf",        "meters": [          {            "meterId": "umt_5e1q3npwt0u6s2k8h9j7rzbc",            "eventName": "input_tokens",            "quantity": 15000000,            "unitPrice": 300,            "unitQuantity": 1000000,            "amountCharged": 4500          }        ]      }    ]  }}

Last updated on