From the The ultimate guide to iOS subscription testing I found this approach to test subscription restore:
One big caveat with iOS testing in the sandbox environment is that there is no receipt file on the device until a purchase is made. This differs from the production sandbox and production environments, where a receipt file is generated at the time of installation. To fully test restoring a purchase in the sandbox, you need to add a button, gesture, or some other means to revert the app to the unsubscribed state.
- Sign up for a monthly subscription.
- Use a button or gesture to revert the app to the unsubscribed state.
- Tap the Restore Purchases button.
- If you do this before the 35-minute subscription cycle is over, an active subscription should be found, and the app should change to the subscribed state.
Question is, how do I perform step 2? Is there any API call I can make to do that?