Test your PurchaseKit integration locally without receiving real Apple webhooks.
Xcode's StoreKit Configuration files let you test purchases in the simulator without connecting to App Store Connect. PurchaseKit automatically detects these purchases and completes them locally.
StoreKit.storekit) and save it in your project
.storekit fileThis automatically imports your subscriptions and keeps them in sync.
.storekit file
To reset and test again:
To test real Apple sandbox webhooks locally:
Expose your local Rails app with Cloudflare Tunnel:
bash
cloudflared tunnel --url http://localhost:3000
In the PurchaseKit dashboard, set your app's Sandbox Webhook URL to your tunnel URL:
https://example-tunnel.trycloudflare.com/purchasekit/webhooks
Make a sandbox purchase on a real device (not simulator)
Watch the webhook arrive in your Rails logs
Apple accelerates sandbox subscriptions for faster testing:
| Production duration | Sandbox duration |
|---|---|
| 1 week | 3 minutes |
| 1 month | 5 minutes |
| 2 months | 10 minutes |
| 3 months | 15 minutes |
| 6 months | 30 minutes |
| 1 year | 1 hour |
The example Rails app includes a script to test webhook handling:
bin/test_webhook created # Test subscription.created
bin/test_webhook updated # Test subscription.updated
bin/test_webhook canceled # Test subscription.canceled
bin/test_webhook expired # Test subscription.expired