Skip to content

Environments

Every transaction, subscription and event has an environment. Your backend decides what each one is worth.

Environment Comes from Treat it as
production Real purchases in the App Store, Google Play, Stripe live mode, real ad networks Revenue
sandbox App Store sandbox and TestFlight, Google test purchases (license testers), Stripe test mode (sk_test_ keys) Not revenue. App Review uses the sandbox, so do not reject it outright
test The Kasskeep test store and test ads Not revenue. Never grant real value in production
  • Apple: from the signed transaction. With apple_environment set to production (the default) an app accepts both production and sandbox transactions and stores them separately. With sandbox it accepts only sandbox.
  • Google: purchases with testPurchase (subscriptions) or testPurchaseContext (one-time products) are recorded as sandbox.
  • Stripe: from the secret key prefix. sk_test_ means sandbox, sk_live_ means production. A webhook whose livemode does not match the key is rejected with 400 livemode_mismatch. Use two Kasskeep apps for test and live keys.
  • Test store and test ads: always test, with platform: "test".

GET /v1/customers/:app_user_id?environment=production returns only production records. Without the parameter every environment is returned and each record carries its own environment field.

Transactions are unique per environment, so a sandbox purchase can never overwrite a production one.