const { result, error } = await unprice.customers.getEntitlements("cus_1234567890");
if (error) {
// handle potential network or bad request error
// a link to our docs will be in the `error.docs` field
console.error(error.message);
return;
}
console.log(result);
{
"entitlements": [
{
"featureSlug": "feature_1",
"granted": true,
"usage": {
"used": 100,
"limit": 1000
}
}
]
}
Request
The ID of the customer to get entitlements for
Response
Array of entitlements for the customer
entitlements[].featureSlug
The slug of the feature
Whether the feature is granted to the customer
Usage information for the feature
entitlements[].usage.used
The amount of usage consumed
entitlements[].usage.limit
The usage limit for the feature