Authorization header:
Kinds of key
Restricted keys
A restricted key only reaches what you allow. Give each service the smallest set it needs: a usage collector only needsusage:write, a paywall only needs entitlements:read.
A scope is {resource}:{access}, such as customers:read or refunds:write. Write access includes read. GET requests need read access and everything else needs write. A request outside the key’s scopes gets 403 permission_denied naming the missing scope, and its Idempotency-Key is not used up.
POST /subscriptions/{id}/items/{item}/preview and POST /subscriptions/{id}/plan-change/preview only need subscriptions:read, since they change nothing.