Our company sells both digital and physical books.
For each book we have a demo app where you can buy the full digital version with an in-app purchase.
For the users that have bought the physical copy of the book, the digital content should be available for free (with a QR code), so we need to by-pass the in-app purchase to show the content.
Does App Store allow a by-pass like that?
As described in the Review Guidelines of the App Store, seems permissible:
3.1.3 “Reader” Apps: Apps may allow a user to access previously purchased content or content subscriptions (specifically: magazines, newspapers, books, audio, music, video, access to professional databases, VoIP, cloud storage, and approved services such as educational apps that manage student grades and schedules), as well as consumable items in multi-platform games, provided that you agree not to directly or indirectly target iOS users to use a purchasing method other than in-app purchase, and your general communications about other purchasing methods are not designed to discourage use of in-app purchase.
https://developer.apple.com/app-store/review/guidelines/#payments
Nevertheless it seems like your app still has to go through in-app purchase to buy new digital content from the app and must not discourage the use of in-app purchase method nor encourage other method.
Hope it helps.