Paywalls & Monetization
NewsTeam’s paywall model is built around billing integrations, entitlements, and content policies.
Instead of hard-coding one paywall provider into the CMS, NewsTeam lets billing plugins describe the products a reader can buy and the entitlement keys those products grant. Your organization then maps those entitlement keys to named content policies, and editors attach those policies to articles.
The model
Section titled “The model”The core flow is:
- A billing integration returns products and entitlement keys.
- Your organization creates a content policy, such as
Premium,Member, orArchives. - The policy says: any of these entitlements unlock content with this policy.
- Editors attach that policy to an article.
- Your website lists products from the connected billing integrations.
- When a logged-in reader buys a product, the billing integration links the purchase back to the reader.
- When NewsTeam checks the reader’s subscriptions, the billing integration returns the entitlements that reader has.
- Those entitlements are matched against the article’s policy.
That keeps commercial configuration out of article body text and out of frontend-only rules. The article carries the policy; the policy carries entitlement requirements; the billing integration carries the product and subscription truth.
Billing integrations
Section titled “Billing integrations”Billing is one of the four integration capabilities in NewsTeam. A billing plugin can provide:
- checkout URLs
- billing portal URLs
- products
- subscriptions
- entitlement keys
- callback handling after purchase
Production source includes Paystack and Polar for billing, plus Entitlement Service for external product/subscription/entitlement reads. Entitlement Service does not implement a usable checkout, portal or callback flow. See provider setup for configuration and activation limits. The same billing contract can be implemented by other providers when an organisation needs a different subscription or membership system.
See Integrations for the broader integration capability model.
Products and checkout
Section titled “Products and checkout”Audience-facing websites can ask the V1 subscription API for available products. Those products come from the connected billing plugins, not from hard-coded frontend pricing tables.
Each product can include:
- product ID
- name and description
- price, currency, and interval
- entitlement keys granted by the product
- whether the current logged-in reader already has access through an active subscription
When a reader chooses a product, the website asks NewsTeam to start checkout. NewsTeam calls the billing plugin, receives a checkout URL, and sends the reader to the provider’s checkout flow.
After checkout, the browser return can be reconciled through subscription.subscribe-callback, which calls the configured billing integration and can update reader attributes used for later subscription checks. This is separate from asynchronous provider notifications; reaching a success URL alone does not prove payment or entitlement.
Developer checkout flow
Section titled “Developer checkout flow”Use the published public client and app ID setup. The app ID identifies the product; checkout, callbacks, subscription reads, portal access and updates require a signed-in reader’s NewsTeam access token. Product listing is public, but hasSubscription is reader-specific when authenticated, so keep personalised results private.
| Raw JSON POST operation | SDK method | Purpose |
|---|---|---|
subscription.list-products | api.subscription.listProducts() | Obtain configured products and their entitlement keys |
subscription.subscribe | api.subscription.subscribe({ productIds, returnUrl, successUrl }) | Start checkout and receive checkoutUrl |
subscription.subscribe-callback | api.subscription.subscribeCallback({ newsteamReference, providerReference }) | Reconcile the provider’s browser return |
subscription.list | api.subscription.list() | Refresh the reader’s subscriptions |
subscription.get-portal-url | api.subscription.getPortalUrl({ id }) | Open the provider’s management portal for a subscription |
subscription.update | api.subscription.update({ id, includesDelivery }) | Optionally change a subscription’s delivery preference |
The raw URL starts with https://api.newsteam.io/v1/; SDK configuration uses the origin without /v1. Raw success bodies are models; SDK calls return { data, error }. Check API recipes and the reference for the exact models.
- Complete the configured identity flow and exchange its provider token with
auth.issueAccessToken. Keep the resulting NewsTeam token server-side for websites or in native secure storage. Validate auth state and registered callbacks before starting checkout. - Read current products and private subscription state. Match product-specific entitlement keys to the article’s content policy; a signed-in reader or an unrelated active subscription is not automatically entitled. Recheck eligibility on the server immediately before checkout.
- Submit product IDs returned by NewsTeam, from the intended billing integration. Construct
returnUrlandsuccessUrlon the server from your approved Site origin and local paths. Reject arbitrary external return URLs. Redirect to the returned checkout URL only after handling API errors. - On the authenticated browser return, validate the purchase/session correlation and the expected NewsTeam/provider references. Call
subscribeCallbackwithnewsteamReferenceandproviderReference. The integration supplies the provider-specific reference format; do not guess query parameter names or treat browser-supplied references as proof of payment. - Refresh
subscription.list, reader/access state and the permitted article response. Invalidate any local member summary. If the provider is still pending or verification fails, show a recoverable pending/error state; do not grant access because the browser reached the success page.
An authenticated server handler can start checkout like this, after validating its session and selected product:
import { NewsTeamApi } from "@newsteam/api";
async function startCheckout(appId: string, token: string, productId: string) { const api = new NewsTeamApi({ appId, accessToken: token, url: "https://api.newsteam.io", }); const products = await api.subscription.listProducts({ cache: "no-store" }); if (products.error) throw new Error(products.error.message); const product = products.data.items.find(item => item.id === productId); if (!product || product.hasSubscription) throw new Error("Product unavailable");
// Use your configured, approved publication origin, never a submitted URL. const origin = "https://your-publication.example"; const checkout = await api.subscription.subscribe({ productIds: [product.id], returnUrl: new URL("/subscribe", origin).href, successUrl: new URL("/subscribe/return", origin).href, }, { cache: "no-store" }); if (checkout.error) throw new Error(checkout.error.message); return checkout.data.checkoutUrl;}Protect these handlers against cross-origin submissions and return private/no-store responses, including redirects and errors. Keep auth, profile, checkout, callbacks, subscription lists and portal URLs out of shared caches at the browser, application and CDN layers. Never log tokens or provider secrets. Account for the billing service’s reconciliation/cache timing rather than interpreting a stale result as immediate success.
Provider webhooks are asynchronous server-to-server notifications. The published SDK’s OnWebhook interface does not prove that your provider validates signatures, processes events idempotently or reconciles subscriptions. Configure and test that path separately from browser returns; see provider release boundaries.
Delivery is optional and product-specific. The published subscription.update request supports id and includesDelivery; it is not a generic cancellation or change-plan endpoint. Only add delivery UI if your product requires it. Use the provider portal or an agreed supported workflow for other management operations.
Before launch, use configured test accounts and the intended billing provider to test successful, cancelled, pending and failed purchases; duplicate returns; invalid references and return URLs; expired sessions; entitlement refresh; and private cache bypasses.
Content policies
Section titled “Content policies”Content policies live in organization settings.
A policy has:
- a name
- an optional description
- one or more entitlement keys
The entitlement selector is populated from billing integrations. For example, if a billing plugin exposes premium_monthly and premium_annual, a policy named Premium can include both. Any reader with either entitlement can unlock content attached to that policy.
This gives commercial teams a stable editorial label while still allowing billing products to change underneath it.
Articles
Section titled “Articles”Articles can carry a content policy.
In Desk, editors can attach one of the organization’s content policies to an article from the article metadata panel. That policy ID is stored on the article and can travel through the API with the article data.
This makes paywall state part of structured content metadata rather than something a site has to infer from tags, sections, or custom body markup.
API enforcement
Section titled “API enforcement”The intended enforcement layer is the V1 API.
The target behavior is that an API request with no valid logged-in reader access token, or with a reader that lacks the required entitlement, can receive a restricted article response with protected body content removed. A request from a reader with a matching entitlement can receive the full article.
API body restriction remains under development. Confirm deployed enforcement with NewsTeam before relying on a content policy to protect paid content. The available foundation includes:
- billing plugins return products, subscriptions, and entitlements
- V1 exposes subscription product, checkout, callback, and subscription listing flows
- organizations can create content policies from entitlement keys
- articles can attach content policies
- logged-in reader requests already use access tokens
Enforcement acceptance
Section titled “Enforcement acceptance”Before enabling a production paywall, confirm the deployed API version and verify these cases with the intended billing provider:
| Reader | Required result for a protected article |
|---|---|
| Anonymous | Protected body bytes absent |
| Expired or invalid token | Protected body bytes absent |
| Signed in without the matching entitlement | Protected body bytes absent |
| Signed in with the matching entitlement | Full permitted article returned |
Run the matrix across direct article reads and relevant list, widget and Site route representations. Inspect plain text, body widgets and serialised client state, not only the visible paywall. Recheck caches with anonymous and authenticated requests. Until this acceptance is confirmed, treat content policy configuration as a model rather than a production body-restriction guarantee.
Why this shape matters
Section titled “Why this shape matters”This model lets a publisher change products, pricing, billing providers, or entitlement names without rewriting editorial workflows.
For example:
- A monthly plan and annual plan can both unlock the same
Premiumpolicy. - A special event product can unlock an
Eventspolicy without changing article metadata. - A future provider can implement the same billing integration contract and continue feeding the same policy model.