Integration Patterns
RevenueCat
Already use RevenueCat? Pass your existing
appUserID.Custom Auth
Have your own auth? Pass your user ID.
Anonymous
No auth system? Email from checkout is used.
Option 1: RevenueCat Users
If you use RevenueCat for subscription management, pass the same user ID:Purchases.shared.restorePurchases().
Set
syncStoreKitTransactions: false when using RevenueCat. This prevents duplicate transaction reporting since RevenueCat already handles StoreKit.Option 2: Custom Auth (Recommended)
If you have your own authentication system:restoreEntitlements(userId:) method fetches all active entitlements from both web checkout and StoreKit sources.
Restoration: Call restoreEntitlements(userId:) after login or on app launch. Works across devices.
Option 3: Anonymous Users
No user system? Users are identified by their email from checkout:userId is empty, the user enters their email during Stripe checkout. ZeroSettle links the purchase to that email address.
Restoration: The user’s entitlements are tied to their email. If you later add user accounts, you can query entitlements using the email they provided at checkout.
Checking Entitlements
After restoring entitlements, check if a user has access:Entitlement includes:
| Property | Type | Description |
|---|---|---|
id | String | Unique entitlement identifier |
productId | String | The product ID this entitlement grants |
source | EntitlementSource | .webCheckout, .storeKit (iOS), or .playStore (Android) |
isActive | Bool | Whether currently valid |
expiresAt | Date? | Expiration date for subscriptions |
purchasedAt | Date | When the purchase was made |
Entitlement Sources
Entitlements can come from three sources:.webCheckout: Purchases made through ZeroSettle’s Stripe checkout.storeKit: Purchases made through Apple’s native StoreKit (ifsyncStoreKitTransactions: true).playStore: Purchases made through Google Play Billing (ifsyncPlayStoreTransactions: true)
restoreEntitlements().
Best Practices
Always pass the same userId
Always pass the same userId
Use a stable identifier that doesn’t change. UUIDs work well. Avoid using email addresses directly as they can change.
Call restoreEntitlements on app launch
Call restoreEntitlements on app launch
This ensures entitlements are synced even if the app was deleted and reinstalled, or if a purchase was made on another device.
Handle the checkout callback
Handle the checkout callback
Implement the universal link handler to capture successful purchases. See the Quickstart for setup.
User ID Guidelines
| Do | Don’t |
|---|---|
| Use your backend’s user ID | Use device identifiers (they change) |
| Use a UUID you generate | Use email (users change emails) |
| Keep it consistent across platforms | Use different IDs per platform |
Quickstart
Get started with the full SDK setup

