Subscriptions

App Store Server Notifications v2 and Google Play RTDN ingestion, SDK linking, lifecycle events, MRR and churn reporting.

Updated 2026-09-02

Flow#

  1. The SDK links the purchase to the install with POST /api/sdk/v1/subscription (StoreKit 2 Transaction.originalID or Play purchaseToken). A trial_start or subscribe event is recorded with the price.
  2. The store sends lifecycle notifications to WhichClick: renewals, cancellations, refunds, grace periods, billing retries, upgrades.
  3. WhichClick updates the subscription, records events (renewal, cancel, refund, reactivate) with revenue, and attributes them to the install's campaign for LTV / ROAS.

Apple#

Configure App Store Server Notifications V2 (production and sandbox) in App Store Connect with URL:

Text
https://app.whichclick.is/api/subscriptions/apple

The signedPayload JWS is verified against Apple's root certificate chain; bundleId must match an app in your organization. Supported notification types: SUBSCRIBED, DID_RENEW, DID_CHANGE_RENEWAL_STATUS, DID_FAIL_TO_RENEW, EXPIRED, GRACE_PERIOD_EXPIRED, REFUND, REVOKE, OFFER_REDEEMED, PRICE_INCREASE.

Google Play#

Create a Pub/Sub topic, enable Real-time developer notifications in Play Console, and add a push subscription with endpoint:

Text
https://app.whichclick.is/api/subscriptions/google

The subscriptionNotification in message.data is decoded; when a Play Developer API service account is configured on the app, the purchase is fetched to read price, period and state. Types handled: PURCHASED, RENEWED, CANCELED, ON_HOLD, IN_GRACE_PERIOD, RECOVERED, RESTARTED, EXPIRED, REVOKED, PAUSED.

SDK call#

POST /api/sdk/v1/subscription
{ "device_id": "<sha256>", "install_id": "ins_01…", "store": "apple", "original_transaction_id": "2000000123456789", "product_id": "pro_monthly", "is_trial": false, "price_micros": 9990000, "currency": "USD", "expires_at": "2026-10-02T09:25:00Z" }

Call it after purchase and on restore; the server de-duplicates on (store, original_transaction_id).

Reporting#

Subscriptions dashboard: active, trials, trial→paid conversion, MRR, churn (voluntary vs. involuntary), refunds, by campaign and product. Subscription revenue is included in ROAS as it is recognised (renewal by renewal), not up-front.