Skip to main content
Do not make a SOAP call to Subscribe to check a customer’s account’s entitlements every time the customer logs in or attempts to access a certain resource. Instead, cache entitlements locally, and query their status at periodic intervals (for example, by making a $entitlement->fetchDeltaSince() call once a day). While caching an Entitlement object for an Account object, remember that the active status of the entitlement is valid only until the endTimestamp value specified on the Entitlement object. If you make periodic Entitlement->fetchDeltaSince() calls, you may receive an updated Entitlement object. If you do not receive such an update, assume that the Entitlement object is still valid. If you are not making periodic Entitlement->fetchDeltaSince() calls to automatically receive updated Entitlement objects, the cached active status of an entitlement is valid until endTimestamp. To proactively obtain an update to the Entitlement object, make an entitlement->fetchByEntitlementIdAndAccount() or Entitlement->fetchByAccount() call. If the Entitlement object is revoked prematurely due to an AutoBill cancellation, your cached records will not be up-to-date. Therefore, make a periodic Entitlement->fetchDeltaSince() call that returns all Entitlement objects that might have changed since the specified timestamp, to maintain current entitlement status. Tip: Create a descriptive and consistent entitlement ID naming system to prevent confusion due to multiple entitlements linked to a single AutoBill or Account object. For example, instead of creating entitlements for one AutoBill object called Standard and Video Only, and for another AutoBill called Blog Access and Video Only, name the entitlements for the first AutoBill Standard Access and Video Only, and the secondBlog Access and Blog Video Only. This allows you to reuse previously defined Entitlement objects in new combinations, without ambiguity. For those customers who wish to access video across your site, you could create an AutoBill which grants Video Only and Blog Video Only entitlements. For your customers who don’t wish to read the Blogs, but do want access to their video content, you could offer an AutoBill that combines Standard Access with Blog Video Only entitlements. Parent topic:Working with Entitlements