Stay organized with collections
Save and categorize content based on your preferences.
Entitlements object
An Entitlements Object is a JSON representation of a single entitlement for a publication, to be associated with a subscription-linked reader account.
Fields
product_id: An identifier formed by merging the publication ID
and the name or level of entitlement.
subscription_token: A publisher-provided string representing their understanding of a subscription. Google stores this, but does not use it for anything.
detail: A user-facing description of the entitlement. This is surfaced in the reader's self-service My Accounts page for better identifying their entitlements.
expire_time: A timestamp in RFC 3339 format. The maximum expire_time is 398 days from now(). If you need to support a longer entitlement period, you must update the expire_time to extend it before it reaches the expire_time.
Entitlements object example
constentitlement={"product_id":"dailybugle.com:basic","subscription_token":"dnabhdufbwinkjanvejskenfw","detail":"This is our basic plan","expire_time":"2022-08-19T04:53:40+00:00"}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-21 UTC."],[[["\u003cp\u003eAn Entitlements Object is a JSON object representing a publication's entitlement linked to a reader's subscription.\u003c/p\u003e\n"],["\u003cp\u003eIt includes fields for product ID, publisher-provided subscription token, user-facing description, and an expiration timestamp.\u003c/p\u003e\n"],["\u003cp\u003eEntitlements have a maximum duration of 398 days and require updating the \u003ccode\u003eexpire_time\u003c/code\u003e field for extensions.\u003c/p\u003e\n"],["\u003cp\u003eGoogle provides resources and examples for creating OAuth service accounts and using JWT for secure communication.\u003c/p\u003e\n"]]],[],null,["# Glossary\n\nEntitlements object\n-------------------\n\nAn Entitlements Object is a JSON representation of a single entitlement for a publication, to be associated with a subscription-linked reader account.\n\n### Fields\n\n- **product_id**: An identifier formed by merging the publication ID and the name or level of entitlement.\n\n| **Note:** Publication ID is a domain name (e.g.**example.com** ) for publishers migrating from the legacy Subscribe with Google. For newly onboarding publishers, it is an auto-generated ID, which can be found in the `publication` query parameter in your Publisher Center URL. For example, if the URL ends with `?publication=CAow-7jBCw`, then **CAow-7jBCw** is your Publication ID.\n\n- **subscription_token**: A publisher-provided string representing their understanding of a subscription. Google stores this, but does not use it for anything.\n- **detail**: A user-facing description of the entitlement. This is surfaced in the reader's self-service My Accounts page for better identifying their entitlements.\n- **expire_time** : A timestamp in [RFC 3339 format](https://www.ietf.org/rfc/rfc3339.txt). The maximum `expire_time` is 398 days from `now()`. If you need to support a longer entitlement period, you must update the `expire_time` to extend it before it reaches the `expire_time`.\n\n### Entitlements object example\n\n const entitlement = {\n \"product_id\": \"dailybugle.com:basic\",\n \"subscription_token\": \"dnabhdufbwinkjanvejskenfw\",\n \"detail\": \"This is our basic plan\",\n \"expire_time\": \"2022-08-19T04:53:40+00:00\"\n }\n\nBackground on GCP OAuth service accounts\n----------------------------------------\n\n- Creating [an OAuth service account](https://developers.google.com/identity/protocols/oauth2/service-account)\n- [Using JWT for signed HTTP REST requests](https://developers.google.com/identity/protocols/oauth2/service-account#httprest)\n- [Officially supported client libraries](https://developers.google.com/identity/protocols/oauth2/web-server#libraries)\n- Example of using a service account with a client library via the [node.js example](https://github.com/googleapis/google-api-nodejs-client#service-account-credentials)."]]