Store APIsUsage
Report usage events
Reports usage events against a subscription's meters. Up to 100 events may be reported per call. Duplicate events keyed by meter_id and external_id are silently skipped. Requires the USAGE_WRITE scope.
AuthorizationBearer <token>
Bearer token authentication. Pass the secret directly in the Authorization header. Token secrets start with sk_.
In: header
Path Parameters
storeId*string
Length
12 <= length <= 48Header Parameters
idempotency-key?string
Length
8 <= length <= 32Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/stores/stringstring/usage/" \ -H "Content-Type: application/json" \ -d '{ "subscription_id": "stringstring", "events": [ { "event_name": "string", "quantity": 0 } ] }'{ "ok": true, "data": { "subscriptionId": "sub_8h4t6sqzy3x9w5n2k1m0vqbf", "accepted": 98, "duplicates": 2, "rejected": [] }}