Nozle
Entitlements

The can() Endpoint

Deep-dive into GET /api/v1/can

The can() endpoint is the core of Nozle's entitlement system.

Request

GET /api/v1/can?customer_id=cust_123&feature=api_calls
Authorization: Bearer pk_live_... (or sk_live_...)

Response

{
  "allowed": true,
  "used": 1500,
  "limit": 10000,
  "remaining": 8500,
  "cost_per_use_cents": 2,
  "revenue_per_use_cents": 5,
  "margin_per_use_cents": 3,
  "min_margin_percent": 20
}

Field reference

FieldTypeDescription
allowedbooleanWhether the customer can use this feature
reasonstring?Why access was denied (if !allowed)
usednumberCurrent usage count this billing period
limitnumberUsage cap for this feature
remainingnumberlimit - used
cost_per_use_centsnumberYour cost per unit (from cost model)
revenue_per_use_centsnumberWhat you charge per unit (from plan pricing)
margin_per_use_centsnumberrevenue - cost per unit
min_margin_percentnumber?Minimum margin threshold if configured

Performance

  • Cached: ~5ms p99 response time
  • Cache is invalidated when subscription changes or usage counters update
  • Automatic fallback if cache is unavailable

Denial reasons

  • No active subscription
  • Feature not included in plan
  • Usage limit exceeded
  • Subscription expired/cancelled

SDK wrappers

Node:

nozle.can('cust_123', 'api_calls')

Python:

nozle.can('cust_123', 'api_calls')

React:

useCan('cust_123', 'api_calls') // with real-time WebSocket updates

On this page