Subscription Data Source
7 min
overview the subscription data source fetches the subscription plans available for purchase from the catalog api it drives subscription walls, plan pickers, and upgrade flows when to use this use subscription when you need to display a list of purchasable subscription plans because plan availability is user specific, always set preventssrcache true basic example { "type" "subscription", "contextkey" "plans", "preventssrcache" true, "filter" { "publication" { "id" { "value" "\ publicationid" } } } } live example view /examples/datasources/subscription configuration type specific properties property type default description filter object — narrows which plans are returned from the api localsort object — client side sort applied after fetching excludepurchased boolean false exclude plans the user has already purchased excludesmaller boolean false exclude plans shorter than the user's active subscription excludehidden boolean true exclude plans marked as hidden onlyadditionalunlocks boolean false return only plans that unlock additional past issues fetchoptions object — optional fetch options (e g totalcount false ) for common properties ( contextkey , limit , batchsize , etc ) see todo insert link to data sources overview link filter properties filter key type description publication publicationfilter restrict plans to a specific publication — use publication id properties mapfilter filter by custom plan properties purchased { value boolean } filter to purchased or non purchased plans productid stringfilter filter by product id supports and , or , and condition localsort properties applied client side after fetching interacts with pagination — use with care property values default criteria default , duration default direction asc , desc asc testing notes / edge cases always set preventssrcache true without it, a cached response may show plans that don't apply to the current user excludepurchased / excludesmaller are client side these exclusions happen after the api fetch and affect visible page size entitlement check this data source returns available plans, not the user's current subscription status related topics todo insert link to data sources overview link