Skip to main content
POST
/
v1
/
entitlements
/
verify
get current feature status
curl --request POST \
  --url https://api.unprice.dev/v1/entitlements/verify \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": "cus_1H7KQFLr7RepUyQBKdnvY",
  "featureSlug": "tokens",
  "timestamp": 1774094400000
}
'
{
  "allowed": true,
  "featureSlug": "tokens",
  "rejectionReason": "LIMIT_EXCEEDED",
  "usage": 42,
  "limit": 100,
  "spending": {
    "ledgerAmount": 4200000000,
    "currency": "USD",
    "displayAmount": "$42",
    "scale": 8
  },
  "message": "Unable to resolve the current meter window for this feature"
}

Documentation Index

Fetch the complete documentation index at: https://docs.unprice.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Body of the request

customerId
string
required

The unprice customer ID

Example:

"cus_1H7KQFLr7RepUyQBKdnvY"

featureSlug
string
required

The feature slug

Example:

"tokens"

timestamp
number

Optional timestamp to inspect a recent point-in-time state. Defaults to the request start time.

Example:

1774094400000

Response

The current feature verification status

allowed
boolean
required

Whether the feature is currently usable for the requested customer and timestamp

Example:

true

featureSlug
string
required

The feature slug that was verified

Example:

"tokens"

rejectionReason
enum<string>

Why the feature is not currently allowed, when applicable

Available options:
CUSTOMER_NOT_FOUND,
EVENT_TOO_OLD,
INVALID_ENTITLEMENT_CONFIGURATION,
INVALID_AGGREGATION_PROPERTIES,
LIMIT_EXCEEDED,
LATE_EVENT_CLOSED_PERIOD,
NO_MATCHING_ENTITLEMENT,
UNROUTABLE_EVENT,
WALLET_EMPTY
Example:

"LIMIT_EXCEEDED"

usage
number

Current usage in the active meter window

Example:

42

limit
number | null

Configured limit for the active meter window

Example:

100

spending
object

Current priced spend for usage features

message
string

Optional detail about the verification result

Example:

"Unable to resolve the current meter window for this feature"