Skip to main content
POST
/
v1
/
customer
/
can
can feature
curl --request POST \
  --url https://api.unprice.dev/v1/customer/can \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": "cus_1H7KQFLr7RepUyQBKdnvY",
  "featureSlug": "tokens",
  "metadata": {
    "action": "create",
    "country": "US"
  }
}
'
{
  "success": true,
  "message": "<string>",
  "deniedReason": "RATE_LIMITED",
  "cacheHit": true,
  "remaining": 123
}

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 customer ID

Example:

"cus_1H7KQFLr7RepUyQBKdnvY"

featureSlug
string
required

The feature slug

Example:

"tokens"

metadata
object

The metadata

Example:
{ "action": "create", "country": "US" }

Response

The result of the can check

success
boolean
required
message
string
deniedReason
enum<string>
Available options:
RATE_LIMITED,
CUSTOMER_SUBSCRIPTION_NOT_FOUND,
ENTITLEMENT_NOT_FOUND,
LIMIT_EXCEEDED,
ENTITLEMENT_EXPIRED,
ENTITLEMENT_NOT_ACTIVE
cacheHit
boolean
remaining
number