← All templates

Store products, receipt validation on the server, restore purchases.

Spec — In-app purchases

Status: draft · Created: 2026-11-10

1. Context and goal

Users buy products and subscriptions through the app stores, and the server decides what they own, so purchases are honored on every device and fraud is rejected.

2. Functional requirements (EARS)

  • FR-1: WHEN the store screen opens, THE SYSTEM SHALL load products with the localized price from the app store within 3 seconds, hiding products the store does not return.
  • FR-2: WHEN a purchase completes on the device, THE SYSTEM SHALL send the receipt to the server, which validates it with the store before granting the product.
  • FR-3: IF a receipt fails validation or was already used by another account, THEN THE SYSTEM SHALL grant nothing and record the attempt.
  • FR-4: THE SYSTEM SHALL finish a store transaction only after the server has granted the product, so an interrupted purchase is delivered on the next launch.
  • FR-5: WHEN the user taps restore purchases, THE SYSTEM SHALL grant every non-consumable product and active subscription the store account owns within 10 seconds.
  • FR-6: WHEN the store notifies a renewal, cancellation or refund, THE SYSTEM SHALL update the user's entitlement within 1 minute.
  • FR-7: THE SYSTEM SHALL grant each consumable product exactly once per transaction id.
  • FR-8: IF the user cancels or the store reports an error, THEN THE SYSTEM SHALL charge nothing, grant nothing and show a message with the reason.

3. Out of scope

  • Payments outside the app stores.
  • Promotional offer codes.