I am not completely sure what you want to share across devices, the earned and bought coins or the purchased things (lets call them "hats").
I also do not have any experience with IAPs, iCloud and CloudKit, what I say here is only from observations and reading documentation.
IAPs can be restored, you can see that in almost any app that uses them to unlock features. If your bought coins cannot be consumed, that will help you get them back. If they can be consumed it will be a little trickier, especially since you will need to watch out for people modifying your data storage to cheat. In any case, unconsumed bought coins could be transferred like earned coins and hats (next paragraph).
Earned coins and hats need to be stored off-device somehow. You have several options here:
- iCloud: For a simple counter (coins) and a checklist of fixed / small size, you could simply store them in preference files (google "iCloud key value storage"). These will then be synced. From what I hear, KV-storage via iCloud works reasonably well.
- CloudKit: Storing data in iCloud using basically your own defined logic. More work than the above, but also more flexible. The storage limit should not matter for the problem you describe.
- Your own server: The most work, and the most flexible. Also frees you from the Apple ecosystem, allowing e.g. an Android version in the future, with cross-platform data transfer.
It all depends on your needs, really. Choose the topmost option that suits all of your needs. In any case, cross-device data transfer can not simply be done with local storage. Restoring a new device from a backup would transfer data, but deleting the app and reinstalling it would purge the data. And using both an iPhone and iPad is also only possible with some sort of cloud-based synching mechanism (leaving out user-initiated WiFi-transfers, I don't think you want that).