InAppPurchases restore purchases example

My app has a subscription option and I’m using InAppPurchases to manage subscriptions. I want to give my users the ability to restore their purchases on a different device but I’m new to the app store and wasn’t sure how to do this with InAppPurchases. There doesn’t seem to be a clear method for doing this in the API and there also doesn’t seem to be an example in the docs. Can anyone provide an example of restoring purchases using InAppPurchases? I imagine this is a fairly common use case and it also might make sense to update the docs to include this. Thank you!