OpenIAP · runnable experience example

Keep the paywall. Connect the purchase.

Try a store outcome, then see what the app and backend actually do.

Local simulation: fictional purchases and Alice’s session. HTTP requests, storage, and event signatures run for real.

1 · Your paywall

Monthly Premium

Signed in as Alice · premium.monthly

Your layout and experiment stay here. The button calls the host app’s purchase function.

Ready to try

Choose an outcome and click Buy Premium.

2 · What happened

The host app’s callback

  1. No callback yet.
Backend access
Locked
Finish calls
0

Finish calls count this page’s simulated store callback. Access is read from the running backend.

Actual request and response
No request yet.

3 · Your analytics / automation service

Receive subscription changes

After a successful purchase, cancel renewal. Premium stays open, and a signed cancellation arrives here.

No events saved.
Actual delivery response
No delivery yet.

Where the requests go

What this implementation adds

The page imports composition/purchase-flow.mjs. Its purchase callback is simulated; fulfillment calls the authenticated app backend over HTTP. That backend verifies, binds, and reads access from the example provider. Store finish runs only after the selected product is confirmed.

The lifecycle controls and denied response are demo fixtures, not Commerce Protocol operations. Replace the fixture purchase/session callbacks with your SDK and login before shipping. This example does not connect a commercial paywall, compute revenue, or make a real payment.