Skip to content

Plans, trial, seats, gifts and promo codes ​

Who: listener (owner, seat member, gift payer or recipient); staff for plans and promo codes; system for renewals.

Entry points ​

KindEntry
REST (plans)GET /subscription-plans?currency&channel, GET /subscription-plans/:code
REST (trial)GET /me/subscription/trial-eligibility?deviceId, POST /me/subscription/trial
REST (subscribe)POST /me/subscription/promo-codes/validate, POST /me/subscription (Idempotency-Key), GET /payments/:id, POST /payments/:id/refresh
REST (manage)GET /me/subscription, GET /me/entitlements, POST /me/subscription/cancel, /resume, PUT /me/subscription/payment-method, POST /me/subscription/pay, POST /me/subscription/plan-change/preview, POST /me/subscription/plan-change, GET /me/subscription/charges
REST (seats)GET/POST /me/subscription/seats, DELETE /me/subscription/seats/:seatId, POST /me/subscription/seats/leave, POST /me/subscription/addon-seats, /addon-seats/remove, GET /me/seat-invites, POST /me/seat-invites/:seatId/accept, /decline
REST (gifts)POST/GET /me/subscription/gift-links, DELETE /me/subscription/gift-links/:id, GET /subscription-gifts/:token, POST /subscription-gifts/:token/checkout, POST /subscription-gifts
REST (stores)POST /me/subscription/store/apple, /google; webhooks POST /webhooks/subscriptions/apple, /google
Staff/staff/subscription-plans…, /staff/promo-codes…, GET /staff/users/:userId/subscription
Deep linksubscribe, trial, subscription, seatInvite, gift, verifyStudent
Push/emailsubscription.* types below

Flow: trial ​

  1. GET /me/subscription/trial-eligibility → eligible | already_used | contact_unverified. One trial per person: account, verified contact, device key (payment fingerprint is not checked yet, see gaps).
  2. POST /me/subscription/trial { planCode, currency, deviceId, method?, promoCode? } → subscription trialing with full benefits for trialDays (7, plus promo extra days). Event subscriptions.subscription.changed.
  3. subscriptions.sweep (scheduled) sends subscription.trial_ending, then converts at trial end: charge succeeds → active; no method or failed charge → expired (subscription.trial_ended).

Flow: subscribe ​

  1. Optional POST /me/subscription/promo-codes/validate (percent, fixed or extra trial days; scope, limits, windows).
  2. POST /me/subscription { planCode, currency, method: wallet|card|bank_transfer, promoCode? } → Checkout { charge, payment { checkoutUrl } }. Wallet usually settles at once; card and transfer open checkoutUrl (Hyparrow).
  3. Payment settles (wallet.webhook-process job, or payments-sweep) → wallet.payment.succeeded → subscription active → subscription.activated; entitlements cache dropped.
  4. Renewal 1 h before period end (subscriptions.sweep). Failure → past_due (dunning retries) → grace → expired. Notifications subscription.renewed, subscription.payment_failed, subscription.expired.
  5. Store channel: the app lists plans with ?platform=ios|android to get each price's store product IDs. Staff set these at /staff/subscriptions/plans/:planId/prices/:priceId/store-products; none are hard-coded. After buying in the store, POST /me/subscription/store/apple|google validates the receipt and resolves the product to a plan price. An unknown product answers STORE_PRODUCT_UNKNOWN. Later state comes from store webhooks (subscriptions.store-notification job). A family add-on seat product sets add-on seats; gifts stay direct-only.

Flow: family and 2geda seats ​

Plan kinds duo (2geda, 2 seats) and family (4) carry seatCount; family can buy add-on seats.

  1. Owner POST /me/subscription/seats { userId } → seat invited, invitee gets subscription.seat_invite (deep link seatInvite).
  2. Invitee POST /me/seat-invites/:seatId/accept → member; entitlements follow the owner's subscription. decline, owner DELETE …/seats/:seatId, member POST …/seats/leave.
  3. Add-on: POST /me/subscription/addon-seats { quantity } → prorated Checkout (free during a trial); remove takes effect at renewal.

Flow: gift and pay-for-me ​

  • Pay-for-me: recipient POST /me/subscription/gift-links → { token, url } (deep link gift). Payer opens GET /subscription-gifts/:token (public) → POST /subscription-gifts/:token/checkout { method }.
  • Gift: payer POST /subscription-gifts { recipientUserId, planCode, … }.
  • On settlement: no subscription → non-renewing gift; trial → becomes paid time; otherwise extended. Recipient gets subscription.gift_received.

Exit states ​

StateCodeActionsClient next
Trial or plan active——Refetch GET /me/entitlements, play full
Trial usedTRIAL_NOT_ELIGIBLEsubscribePlans screen
Contact unverifiedTRIAL_CONTACT_REQUIREDverify_email, verify_phoneVerify, retry
Already subscribedSUBSCRIPTION_ALREADY_ACTIVEopenSubscription screen
Store-managedSUBSCRIPTION_CHANNEL_MISMATCHopenSend to App Store / Play
Payment pendingSUBSCRIPTION_PAYMENT_PENDINGwaitPoll GET /payments/:id
Student planPLAN_STUDENT_VERIFICATION_REQUIREDverify_identityAlways refused today (I17)
Price missingPLAN_PRICE_UNAVAILABLE, PLAN_NOT_FOUND—Pick another currency/plan
PromoPROMO_CODE_INVALID, PROMO_CODE_NOT_APPLICABLE, PROMO_CODE_EXHAUSTED, PROMO_CODE_USER_LIMIT—Clear the code
SeatsSEAT_PLAN_HAS_NO_SEATS, SEAT_LIMIT_REACHED, SEAT_ALREADY_MEMBER, SEAT_SELF, SEAT_INVITE_INVALID, SEAT_ADDON_UNAVAILABLE—Show the title
GiftGIFT_LINK_NOT_FOUND, GIFT_LINK_CLOSED, GIFT_SELF—Empty state
Store receiptSTORE_RECEIPT_INVALID (contact_support), STORE_PURCHASE_TAKEN, STORE_UNAVAILABLE (retry)as listed—
WalletWALLET_INSUFFICIENT_FUNDStop_upTop up

Notifications ​

subscription.trial_started, trial_ending, trial_ended, activated, renewed, payment_failed, expired, gift_received, seat_invite; receipt payment.receipt.

Known gaps ​

  • Student plans are closed: isVerifiedStudent is always false (I17).
  • Trial abuse by payment fingerprint is not checked (I18).
  • Referral reward days are never credited (B2).
  • Deactivated accounts keep renewing (I8).

Plemuz API v2