Summary: How a 7Mind app subscription product (a store SKU) is wired together on the Gymondo platform: the store product, the Contentful Product with its prices, condition and role, the checkout tier card that puts it on the paywall, the productsConfig.json allow-list, the 7Mind app, and the backend path that turns a purchase into premium. Sources: Gymondo-git code read on 2026-10-06: terraform-workspace-service-gateway resources/gateway/cmd/product-change-v3/ (incl. data/productsConfig.json, internal/products/legacyproductsclient.go), service-content-mapper (ProductMapper, ProductImpl, CreateEventCreateProcessor, StorageConfiguration), function-product-v1 (application/product/validator.go, productrequesteventhandler.go), Gymondo-2.0 gpscheduler ProductComponent and DefaultProductService, function-sync-receipt, function-app-store-receipt, function-subscription, function-user-role, function-sevenmind-legacy-gateway (internal/domain/monetization/, internal/billingperiod/, docs/prevention-article-roles.md, docs/superpowers/specs/2026-09-12-coupon-freebie-twin-products-design.md), Gymondo-git/terraform workspaces/apps/service-{prod,test}.tfvars; Gymondo Contentful space m5ivwq1dbwv8 (entries read 2026-10-06); sevenmind/7mind-mobile-apps-monorepo lib/features/monetization/; Notion “How to create new products and all around it” and DNA-5629; Slack fitness-checkout-helpdesk and fitness_ask-product; the MIND-846 price experiment; function-product-v1 producteventhandler.go and service.go (status transitions), read on 2026-10-27; the app side re-read on 2026-11-09 from 7mind-mobile-apps-monorepo origin/main at 4.0.9 (api_monetization_repository.dart, in_app_purchase_product_service.dart, pay_wall_cubit.dart, intro_offer_arm.dart, braze_feature_flags.dart, PRs 1577, 1586, 1591) Last updated: 2026-11-09


The short version

The article number is the key that ties everything together. For app products it is the store product id, for example multi.7mind.sub.ios.yearly.

A store SKU only shows up on the 7Mind paywall when four places agree on the same article number:

  1. The store (Play Console or App Store Connect) sells a subscription with that id.
  2. A Contentful Product with that articleNumber exists, with a country config for the user’s storefront country. It is synced into Gymondo’s product catalog.
  3. A Contentful checkout package with that articleNumber sits in the 7Mind tier card for the platform.
  4. The hardcoded allow-list productsConfig.json of the product-change-v3 Lambda contains the id.

The app needs no change: since MIND-877 (app 4.0.6) it asks the store for every article number in the catalog response. An experiment SKU (_abtest_ in the article number) is the exception: the app only sells it to users in the Braze arm that names it.

Buying is much looser. The receipt path accepts any store product id, and premium comes from the subscription record, not from the catalog. The userRole linked from the Contentful Product only decides which extra roles the buyer gets.

There is one Contentful space and one productsConfig.json for staging and production, so a paywall change is live in both environments at once. See Staging and production.

Diagrams

What the app can sell

flowchart LR
  subgraph CF["Contentful (one space for staging and prod)"]
    PROD["Product<br/>articleNumber = store id"]
    PCC["ProductCountryConfig<br/>country, currency, price"]
    COND["ProductCondition<br/>12 MONTHS, trial 7 DAYS"]
    ROOT["ComponentTierChange<br/>slug ...-tier-change-int"]
    PKG["Tier card packages<br/>articleNumber per package"]
  end
  subgraph GYM["Gymondo backend (per environment)"]
    CATALOG["Product catalog<br/>row per country + _trial row"]
    PAGES["Content page table"]
    LAMBDA["product-change-v3 Lambda"]
    ALLOW["productsConfig.json<br/>allow-list, shared"]
  end
  subgraph APP["7Mind app"]
    REPO["ApiMonetizationRepository"]
    ARM["Braze arm<br/>ff_app_intro_offer_experiment"]
    PAYWALL["Paywall"]
  end
  STORE["Play / App Store<br/>product with the same id"]

  PROD --> PCC
  PROD --> COND
  ROOT --> PKG
  PKG -. "same articleNumber" .-> PROD
  PROD -- "content mapper" --> CATALOG
  ROOT -- "content mapper" --> PAGES
  CATALOG --> LAMBDA
  PAGES --> LAMBDA
  ALLOW --> LAMBDA
  LAMBDA -- "api/v3/sevenmind/products" --> REPO
  REPO -- "catalog article numbers" --> STORE
  ARM -. "experiment SKU" .-> REPO
  STORE -- "price, currency, offers" --> REPO
  REPO -- "only ids known to both" --> PAYWALL

A product reaches the paywall only if all of these line up:

  • Contentful page: a package for it is in the tier card.
  • Allow-list: productsConfig.json lists it.
  • Catalog: it has a row for the user’s country, synced from the Product.
  • Store: the store app the user runs sells it. The app asks for every catalog id, so the store app is what keeps staging SKUs off the production paywall and the other way round.

What a purchase does

flowchart LR
  PAYWALL["Paywall"] -- "buy" --> STORE["Play / App Store"]
  PAYWALL -- "receipt" --> RECEIPT["function-sync-receipt (Android)<br/>function-app-store-receipt (iOS)"]
  STORE -- "renewals, cancellations" --> RECEIPT
  RECEIPT --> SUBS["function-subscription<br/>service-subscription<br/>articleNumber = store id, no catalog lookup"]
  SUBS --> GW["legacy gateway<br/>monetization/subscriptions/status"]
  GW -- "isPremium" --> PAYWALL
  SUBS --> ROLES["function-user-role<br/>ROLE_SUBSCRIPTION_ACTIVE + placeholders"]
  PRODROLE["Contentful Product.userRole<br/>roleList ROLE_SEVENMIND, ROLE_SEVENMIND_PLUS"] -- "via function-product-v1, if the article is known" --> ROLES

Premium comes from the subscription record alone. The catalog and the role do not decide whether a buyer gets access; the role only adds the 7Mind roles on top.

The pieces

PieceWhere it livesWho reads itWhat it controls
Store productPlay Console, App Store Connect; separate staging appsThe app (price, currency, purchase), the receipt functionsWhether the product can be bought, its price, the free trial
ProductContentfulservice-content-mapper, then function-product-v1 and the Gymondo-2.0 product tableCatalog row per country: price, interval, trial child row, vendor, role
ProductCountryConfigContentful, linked from ProductSame as ProductOne country with currency, unit price and total price. Can be shared by several products
ProductConditionContentful, linked from ProductSame as ProductDuration and interval (12 MONTHS), trial duration and interval (7 DAYS)
userRole / userBaseRoleContentful, userRole linked from Productfunction-user-role (synced into DynamoDB)Roles granted to a buyer of that product
ComponentTierChange and its treeContentfulservice-content-mapper, then the content page tableWhich packages the paywall lists, plus titles, banners and highlight
productsConfig.jsonGymondo-git/terraform-workspace-service-gateway, resources/gateway/cmd/product-change-v3/data/product-change-v3 onlyAllow-list: a package is dropped unless its article number is here
ApiMonetizationRepository7mind-mobile-apps-monorepo, lib/features/monetization/repositories/The paywallAsks the store for the catalog ids, hides _abtest_ SKUs, picks one product per paywall card
Braze flag ff_app_intro_offer_experimentBraze, 7Mind workspaceConfigurations in the appWhich users get an experiment product and which badge texts the yearly card shows (MIND-910)

Contentful content model

flowchart LR
  ROOT["ComponentTierChange<br/>selected by slug"] -- content --> CARDS["componentCheckoutTierCards"]
  ROOT -- config --> CFG["ComponentTierChangeConfig<br/>allowVouchers, discountDisplayMode"]
  CARDS --> CARD["componentCheckoutTierCardItem<br/>title, tier PLUS, usps"]
  CARD -- packages --> PKG["componentCheckoutPackageItem<br/>internal name, title, bannerText,<br/>articleNumber, isHighlighted"]
  PKG --> VOUCHER["componentCheckoutVoucherDefinitionItem<br/>NONE for 7Mind"]
  PKG -. articleNumber .-> PROD["Product<br/>articleNumber, paymentServiceProvider,<br/>type, status, vendor, group"]
  PROD -- countryConfig --> PCC["ProductCountryConfig<br/>countryCode, currency,<br/>unitPrice, totalPrice"]
  PROD -- conditions --> COND["ProductCondition<br/>duration, interval,<br/>trialDuration, trialInterval"]
  PROD -- userRole --> UR["userRole<br/>name"]
  UR -- roleList --> UBR["userBaseRole<br/>ROLE_SEVENMIND, ROLE_SEVENMIND_PLUS"]

The paywall tree

The root is a ComponentTierChange. The Lambda selects it only by its slug field and the user’s language. The internal names ([DEF], [MOBILE]) are naming conventions that no code reads.

PlatformRoot (ComponentTierChange)Tier card holding the packages
Android[DEF][SEVENMIND][GOOGLE] Google Go Premium Global, slug /tiers/sevenmind-google-tier-change-int[DEF][SEVENMIND][GOOGLE][PLUS] Tier Card
iOS[DEF][SEVENMIND][APPLE] Apple Go Premium Global, slug /tiers/sevenmind-apple-tier-change-int (from the Lambda’s slug rule, not checked in Contentful)[DEF][SEVENMIND][APPLE][PLUS] Tier Card

The Lambda builds the slug as /<lang>/tiers/sevenmind-<platform>-tier-change-int. The -int suffix comes from 7Mind only having a DEFAULT_INT entry in productsConfig.json.

Each tier card lists production and staging packages side by side. The Android one, for example, has “Google 12M Reduced No Trial”, “Google 12M Reduced”, “Google 1M”, “Google 12M Staging”, “Google 12M Reduced Trial” and “Google 1M Staging”. The package help text says the article number “must match with backoffice”. The Back Office catalog is the Product model below.

Product

These fields are as seen on the live 7Mind product multi.7mind.sub.ios.yearly (created by Ahmed Bayoumy, 2026-09-18) and on Gymondo’s own new store product plus_buddyfit_android_202511_1m:

FieldValue for a 7Mind store productNotes
Article NumberThe exact store product idNo whitespace. At most 50 characters (MySQL article_number)
Payment Service ProviderGOOGLE or APPLEBecomes the catalog type field
TypeONE_OFF on every live store product seenRECURRING exists too. What it changes for store products was not verified; copy the live ones
Country ConfigOne ProductCountryConfig per country, for example DE, EUR, 77.99The catalog only returns the product for countries that have a config
User RoleA userRole named ROLE_ + the upper-cased article numberConvention from the gateway’s twin-products spec. Gymondo-style names like ROLE_SEVENMIND_PLUS_ANDROID_ABTEST_202610_12M also work, since matching is by name
StatusDRAFT while editing, then PUBLISHEDA field, separate from Contentful’s own draft state. Final once it leaves DRAFT. See the gotchas
ConditionsDuration 12, Interval MONTHS, Trial Duration 7, Trial Interval DAYSUse 12 MONTHS, not 1 YEARS: lengthInMonths is parsed from the leading number
VendorSEVENMIND
GroupemptyUsed for PREVENTION, CORPORATE, PARTNER and B2B products
Next ProductemptyUsed for upsell and downsell chains on the web

The role of a 7Mind store product lists ROLE_SEVENMIND and ROLE_SEVENMIND_PLUS. Do not add a vendor or shadow role: ROLE_FASTSPRING_SHADOW and ROLE_CHARGEBEE_SHADOW mark web subscriptions billed outside Gymondo.

Migrated 7Mind products also exist: one entry per store id, Play base plan and currency, for example multi.7mind.sub.android.yearly.red-multi-7mind-sub-android-yearly-red-trial-EUR. They have status DISCONTINUED and an auto-generated role per entry (DNA-5629). They carry history and are not a template for new products.

How the paywall catalog is assembled

The app calls GET magic.7mind.de/api/v3/sevenmind/products/{google|apple}?countryCode=DE (staging magic.6mind.de). Kong routes it to the product-change-v3 Lambda, not to function-sevenmind-legacy-gateway. The Lambda does four things:

  1. Allow-list. Reads productsConfig.json. For 7Mind there is a single entry: sevenmind, DEFAULT_INT, ROLE_DEFAULT, then the platform, tier PLUS, and its list of products.
  2. Page. Loads the published page for the slug from the content page table.
  3. Catalog. Calls Gymondo-2.0 GET /api/v3/secured/{google|apple}/products?countryCode=. This returns the active rows of the MySQL product table for that country, with no vendor filter, cached for 60 seconds.
  4. Merge.
    • A package whose article number is not in the allow-list is dropped silently.
    • A package that is allowed but has no catalog row (no Product, no country config for that country, or DISCONTINUED) is still returned, with an empty product: article number "", price 0. The response is still 200.
    • The whole response fails with 500 only if the page slug is missing or the root is unpublished, the catalog call fails, or the allow-list does not parse.

Where the response fields come from:

  • Contentful page: title, subtitle, config, tier texts, packages[].metadata.
  • Catalog: packages[].product. That is price (country total price), interval and lengthInMonths (from the condition), the <article>_trial child (price 0, from the trial fields) and type (from the payment service provider).

Then the app (7mind-mobile-apps-monorepo, ApiMonetizationRepository) does its own filtering:

  • It asks the store for every article number in the response, in catalog order, and keeps only products the store returns. Packages with an empty product are skipped.
  • It only knows two lengths: lengthInMonths 12 (yearly) and 1 (monthly). A product of any other length is skipped. The trial length comes from the _trial child.
  • Article numbers containing _abtest_ are hidden unless the user’s Braze arm names them (MIND-915 will replace this naming rule with a catalog tag).
  • It drops trial products for users who are not trial-eligible: the backend trial allowance, and on iOS the App Store’s introductory offer eligibility for the Apple ID (MIND-870).
  • On Google Play it buys a trial product through an offer that starts with a free phase, preferably one as long as the catalog trial; Play only returns such an offer to eligible users, and without one the trial product is left out (MIND-868).
  • It keeps one product per paywall card (yearly, yearly with trial, monthly): the first in catalog order, with an arm’s test product placed first. A second regular product for the same card is logged as an error.
  • PayWallCubit needs a yearly product without trial and a monthly product; without them the paywall shows an error. The yearly trial product is optional.
  • The price on the paywall is the store’s price. The catalog price is not shown.

How a purchase becomes premium

  • Android. POST api/v4/sevenmind/receipts/google/sync goes to function-sync-receipt. It checks only that the bundle id is configured for the vendor and publishes an event. function-app-store-receipt then verifies the token with Google.
  • iOS. POST api/v1/sevenmind/receipts/transactions goes to function-app-store-receipt, which fetches the transaction from Apple.
  • Subscription. In both cases function-subscription creates the subscription with the store product id as its article number. There is no catalog lookup, so an unknown product id still produces a subscription and premium.
  • Premium flags. The app’s monetization/subscriptions/status call is answered by function-sevenmind-legacy-gateway, which computes isPremium and isInFreeTrial from the service-subscription records only.
  • Roles. function-user-role stamps ROLE_SUBSCRIPTION_<STATUS> and placeholder roles. If function-product-v1 knows the article number, it also adds the flattened roleList of the product’s userRole. A role that is not synced yet is retried. Content unlock in the gateway keys on the subscription roles, not on ROLE_SEVENMIND_PLUS.
  • Free trial. It exists only in the store (Play offer, Apple intro offer). The backend drops isInTrialPhase, so for store trials isInFreeTrial is false and freeTrial is null. The subscription ends at the store’s expiry, and premium after day 7 depends on the renewal notification.
  • Renewals and cancellations. Play RTDN and App Store server notifications go to the event broker (/api/v2/app-store-receipts/{apple,google}/...) and on to function-app-store-receipt. The vendor is found from the bundle id. A new SKU needs no registration here.

Staging and production

Staging (magic.6mind.de, Gymondo service-test)Production (magic.7mind.de)
ContentfulSpace m5ivwq1dbwv8, environment masterThe same space and environment
Content syncPreview mode: every create and save is synced, drafts includedPublish and unpublish events only
Catalog, product and page tablesOwn copiesOwn copies
productsConfig.jsonOne file compiled into bothSame file
Android app and storede.seven_mind.android.stg, its own Play appde.sevenmind.android
iOS app and storede.7mind.ios.stg, its own App Store Connect appde.7mind.iphone
Ids the app asks forEvery article number in the catalog response; only the staging store apps’ SKUs come backEvery article number in the catalog response; only the production SKUs come back

So:

  • A tier card or allow-list change reaches both environments.
  • A Contentful draft can already be live on staging.
  • A staging test of a new SKU needs the product in the staging store apps. No app change is needed.

Gotchas

  • Product status field. It is separate from Contentful’s draft and published state. The mobile catalog treats DRAFT and PUBLISHED as active; DISCONTINUED is inactive. function-product-v1 only accepts field edits while the status is DRAFT, and a product never goes back to DRAFT (producteventhandler.go, service.go). Once a product leaves DRAFT it cannot be changed, so set every field first and switch to PUBLISHED last. A change to a live product is a new plan with a new article number; see Changing a live SKU.
  • Republish the root. The content mapper stores a snapshot of the whole page tree when the root ComponentTierChange is processed. After editing a package or tier card, publish the root again. This is inferred from the code (the republish helper is never called).
  • Shared country configs. A ProductCountryConfig can be linked from several products. Editing its price changes all of them, so create a new one for a new price.
  • No country keys for 7Mind. Do not add a country key (for example DE) under sevenmind in productsConfig.json. The slug then becomes ...-tier-change without -int, and the response is 500 unless such a page exists.
  • Allow-list deploys. A productsConfig.json change only takes effect after the Lambda is redeployed.
  • Article number naming. End it with the period, like _12m. The legacy gateway derives the subscription label from the article number (internal/billingperiod). Gymondo’s naming scheme is [vendor]_[tier]_[platform]_[department]_[descriptor]_[country]_[YYYYMM]_[period]. Gymondo uses test_a, test_b as A/B descriptors, but the 7Mind app only recognises an experiment SKU by _abtest_ in the article number (for example sevenmind_plus_apple_abtest_202610_12m). A test_a SKU lands on the regular paywall for everyone and competes with the regular product for its card.
  • Never unpublish or delete a store product that people have bought. That cancels their subscriptions.
  • Play base plans and offers. A Play subscription with a base plan and a free-trial offer returns one product details object per base plan and per offer under the same id. The app picks an offer that starts with a free phase, preferably as long as the catalog trial (MIND-868), and for an intro offer test product the offer with the discounted payment. Check on a real device that the trial offer is the one bought and that the price is not 0.
  • Apple subscription group. A new App Store subscription belongs in the same subscription group as the existing 7Mind ones. Otherwise one user can hold two subscriptions.
  • Store prices win in the app. The paywall shows the store price. Keep the Contentful country price in line anyway: the catalog, reporting and the web use it.

Not verified yet

  • That the 7Mind apps in App Store Connect and Play send their server notifications to the Gymondo event broker, and that credentials for both 7Mind bundles exist in each environment.
  • What Product.Type (ONE_OFF or RECURRING) changes for store products.
  • That new store subscriptions are created with an empty subscription type. The gateway then reports them as cannot_be_cancelled, which hides the “manage in store” hint.
  • That Apple refunds revoke premium. The code maps REFUND to CANCELLED, which function-subscription ignores.