Reliability — never missing a payment
A missed renewal locks out a paying customer; a missed refund gives away the product. Appwind Pay is built so neither depends on any single request, server or notification arriving.
1. Store notifications are saved before they're answered
Every Apple and Google notification is written to the database first; only then does Appwind Pay answer 200. If the database can't save it, Appwind Pay answers 503 and the store sends it again (Apple retries for days; Google Pub/Sub for up to 7 days). Duplicates are recognised by their ID and dropped.
2. Processing is retried for 7 days
If processing fails — Apple's API timed out, a deploy restarted the server — the notification stays in the inbox and is retried after 1, 5, 15 minutes, 1, 3, 6, 12 hours, then daily for a week. A server that dies mid-way leaves a claim that expires after 5 minutes; another server picks it up. Anything still failing after 7 days is set aside, you're alerted, and Process failed again retries it.
3. Catching up with Apple and Google
Every 6 hours Appwind Pay asks Apple for its notification history (production and sandbox, last 3 days) and Google for voided purchases (refunds, chargebacks, revokes). Anything Appwind Pay never received goes through the inbox like a normal notification (shown as caught up). A server that was down for two days loses nothing. Run it by hand: python -m upwall reconcile --hours 168.
4. Subscriptions are re-checked before they lapse
Every 5 minutes Appwind Pay asks the store about:
- subscriptions that expire within 15 minutes (or expired in the last 7 days) with no update for 30 minutes — the renewal notification may be late or lost;
- subscriptions in grace, billing retry, on hold, paused or pending not checked for 6 hours.
A renewal found this way sends the normal
RENEWALevent; a real expiry sendsEXPIRATION.
5. Google acknowledgements
Google refunds purchases that aren't acknowledged within 3 days. Failed acknowledgements are retried every 15 minutes; after 2 days you're alerted; the Android SDK also acknowledges on the device when Appwind Pay can't be reached.
6. The apps don't wait for us
The SDKs unlock from the device's own verified purchases when Appwind Pay is down, queue purchases until Appwind Pay confirms them, keep the last offerings and paywall, and switch to backup servers (fallbackServers).
7. Webhooks to your server
Retried for about 6 days with back-off, signed, deduplicated by X-Appwind-Event-Id, resendable. Several servers send in parallel without double-sending.
8. Alerts and monitoring
Alerts show in the dashboard and, if you set alert_webhook in config.yaml (Slack or Discord incoming webhook), in your chat:
- a notification failed for 7 days; notifications waiting more than 15 minutes (worker stopped?);
- webhooks to your server failing for 6 days;
- Apple or Google rejecting your key (renewals can't be checked);
- a Google acknowledgement refused for 2 days.
Point an uptime monitor (UptimeRobot, Better Stack…) at https://pay-api.appwind.ai/health/queues: it answers 503 when notifications back up or a background job is late.
9. Every purchase locks only itself
Work on one purchase is serialised with a database lock on that purchase, so a notification, a refresh and the SDK arriving at the same moment can't overwrite each other — on one server or ten.