Entitlements
Know what each customer can use, whichever engine runs the subscription, with one service for access, features, seats, balances, and store purchases.
Query one endpoint to check what a customer can use, whether they subscribed on your website, in your app, or through an app store, and whichever engine runs their subscription. You don't need separate access logic for each engine or store.
What entitlements cover
Each entitlement type tracks one dimension of customer access:
| Entitlement | Purpose |
|---|---|
| Access | Whether the customer can use your product now |
| Features | Which features their plan includes |
| Seats | How many seats they have, as seats are added and removed |
| Balances | What's left of an allowance, such as credits |
| Store purchases | What they bought through Apple's or Google's stores |
You define features and map them to products in the Commerce tab.
Read a customer's entitlements
Retrieve a customer's entitlements with GET /v1/entitlements and their customer_reference_id. Each one has its type, the key you gave the feature in the Commerce tab, its status, and where it came from in source. The customer can use an entitlement while its status is granted or grace, and loses it at revoked.
curl -G https://api.sandbox.pay.com/v1/entitlements \
-u ':sk-pay-com-sandbox-…' \
-d customer_reference_id=cust-jane-doe-001{
"resource": "entitlements",
"data": [
{
"id": "entl_691204573645987840",
"resource": "entitlement",
"type": "access",
"key": "pro",
"status": "granted",
"expires_at": null,
"source": { "type": "subscription", "subscription": "sub_684790996696828928", "engine": "pay_com" }
},
{
"id": "entl_691204574121451520",
"resource": "entitlement",
"type": "seats",
"key": "team-seats",
"status": "granted",
"quantity": 12,
"source": { "type": "subscription", "subscription": "sub_684790996696828928", "engine": "pay_com" }
}
],
"has_more": false
}Pay.com sends entitlement.updated when what a customer can use changes, and subscription.access.updated when a subscription's access changes. A payment event doesn't mean the customer has access, so grant and revoke access from these events. See List entitlements in the Commerce API reference.
Whatever the engine
Entitlements work the same for subscriptions on Pay.com's engine, on an external engine such as Stripe Billing, and for app store purchases. See Choose a subscription engine.
Fulfill orders from the webhook
You fulfill one-time orders and bookings from the payment webhook, order.paid. Use entitlements for ongoing access, features, seats, and balances.
In your reports
App store subscriptions reported through entitlements count in your MRR and subscribers, once each, alongside the subscriptions Pay.com and your engines run. See Insights and metrics.