Billing

Stripe

Connect Stripe so invoice-based sales attach to the creator who drove the install or whose code was used at checkout: subscriptions, renewals, and one-time payments only when Stripe creates an invoice, plus refunds and credit notes. Work in Tap App Link first, then click through the Stripe dashboard with the values you copied.

Vendor reference: Stripe webhook docs · Dashboard: https://dashboard.stripe.com

1. Copy the URL from Tap App Link

  1. Open your app, then Revenue.
  2. Switch the workspace to the environment you are connecting (Sandbox or Production). Each environment has its own URL and secret.
  3. Select Stripe. A restricted key works with any Stripe account. If Connect with Stripe is set up for your workspace, you can use it instead.
  4. With a restricted key, copy the webhook URL, create the endpoint in Stripe, then paste Stripe's signing secret (whsec_…) into Tap App Link. If you use Connect with Stripe instead, the webhook endpoint is created for you.

2. Identify in your app

After trackInstall(), call setAppUserId() with the same customer id the provider puts on webhooks.

subscription_data.metadata.app_user_id / setAppUserId

  1. Set metadata.app_user_id on the subscription (for example subscription_data.metadata in Checkout) so it reaches the invoice. Pass that same id to setAppUserId() in the app so web and app purchases join up.
  2. Tap App Link also reads app_user_id / appUserId / tal_app_user_id from invoice metadata, subscription metadata, and the first line item. If those are missing, it uses the Stripe customer id (cus_…). Email is used only when there is no customer id.
  3. Creator attribution on web does not require an app open when a promotion code or tap_creator_code metadata is present.
// Checkout Session (subscription)
const session = await stripe.checkout.sessions.create({
  mode: "subscription",
  // Optional: keep for your own records. Invoice webhooks do not receive this field.
  // client_reference_id: buyerId,
  subscription_data: {
    metadata: {
      app_user_id: buyerId, // same id you pass to TapAppLink.setAppUserId()
      tap_creator_code: creatorCode, // optional when a promotion code is applied
    },
  },
  // ...
});

3. Stripe dashboard

  1. In Tap App Link, open Apps → Revenue, select Stripe. A restricted key (rk_…) works with any Stripe account. If Connect with Stripe is set up for your workspace, you can use it instead.
  2. If you used a restricted key: copy the webhook URL, add the endpoint in Stripe → Developers → Webhooks, subscribe to invoice.paid, charge.refunded and credit_note.created, then paste Stripe's signing secret (whsec_…) into Tap App Link before saving the key.
  3. If you used Connect with Stripe: the endpoint and events are set up for you. Skip to a test purchase. Do not create a second endpoint in Stripe.
  4. Creator codes sync as Stripe promotion codes after connect. New codes sync when you create a discount.

A restricted key works with any Stripe account: add the endpoint in Stripe, then paste the signing secret Stripe shows (whsec_…) into Tap App Link. If you use Connect with Stripe instead, Tap App Link creates the webhook endpoint for you.

4. Events to keep enabled

Leave these event types on. Extra events are ignored. Unknown names return 2xx so the provider does not retry forever.

5. Discount codes (optional)

Creator discount codes sync as Stripe promotion codes when Stripe is connected. Buyers can redeem them at Checkout. Metadata keys tal_code and tap_creator_code also credit the creator.

Full product guide: Discount codes.

6. Verify in sandbox

  1. Switch Tap App Link to Sandbox and open the Live Attribution Debugger.
  2. Start a link session, scan the QR, then launch the test build with the sandbox SDK key.
  3. Confirm the timeline reaches install matched and billing customer linked. If you retry, call resetForTesting() in debug builds first.
  4. Trigger a sandbox purchase and confirm a paid event on the timeline.

Other providers

RevenueCat · Superwall · Adapty · Qonversion · Billing overview

Questions: support@tapapplink.com.