Pandabase
Store APIsUsage

Report usage events

POST
/stores/{storeId}/usage/

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.

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

Header Parameters

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

Request 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": []  }}

Last updated on