All app-server protocols: handshake sync, in-app purchases, and event logging
| Endpoint | Purpose | Auth |
|---|---|---|
| /functions/v1/handshake | Content sync, user data, manifest | JWT Bearer |
| /functions/v1/validate_purchase | Course & subscription IAP validation | JWT Bearer |
| /functions/v1/validate_purchase_ai_credits | AI credits IAP validation | JWT Bearer |
| /functions/v1/app_logs | Event logging | JWT Bearer |
All endpoints authenticate via JWT. User ID is extracted from the token — never sent in the payload.
Purchases are NOT acknowledged until the server validates the receipt. If validation fails, the purchase stays unacknowledged and Google/Apple auto-refunds after 3 days.
| Product | Android | iOS |
|---|---|---|
| Course (e.g. H01ENB) | h01enb | me.hypnoelp.app.h01enb |
| Subscription | hypnoelp_subscriptions | me.hypnoelp.app.subscription_1month |
| AI Credits (4K) | ai_credits_4000 | me.hypnoelp.app.ai_credits_4000 |
| AI Credits (10K) | ai_credits_10000 | me.hypnoelp.app.ai_credits_10000 |
| Custom Audio | x99enb | me.hypnoelp.app.x99enb |
| Feature | Android | iOS |
|---|---|---|
| Course Purchase | Google Play Billing | StoreKit |
| Subscription | Multi-plan | Monthly only |
| AI Credits | Consumable | Consumable |
| Upgrade/Downgrade | With proration | N/A (single plan) |
| Free Trial | Pricing phases | App Store managed |
| Receipt Source | serverVerificationData | Method channel (app_receipt) |
Logs sent to /functions/v1/app_logs with user_id, log_type, message, origin, and timestamp.
| Requirement | Value |
|---|---|
| JSON formatting | 4-space indentation |
| Line endings | CRLF (\r\n) |
| Field order | LinkedHashMap (preserves server order) |
| Hash algorithm | MD5 of raw file bytes |