Talivia Docs
Talivia Docs
HomeDashboard
IntroductionInstallationTeamGetting updates
Stripe
Stripe Checkout SessionsStripe Payment LinksStripe Payment IntentsStripe subscriptions and invoicesOther Stripe methodsTest and troubleshoot Stripe attribution
Yolfi
Dodo Payments
LemonSqueezy
Polar
Manual Payment APITesting payment integrations
Integrations
llms.txtllms-full.txt
RevenueStripe

Stripe subscriptions and invoices

Preserve attribution across subscription signup, renewals, failures, and lifecycle changes.

View Markdown

Recurring revenue has two related attribution problems: matching the original subscription signup and reconnecting later invoice payments to the same customer journey.

Attribute subscription signup

When Checkout creates the subscription, set the Talivia session on both the Checkout Session and the downstream Subscription.

Subscription metadata
const metadata = {
  talivia_session_id: sessionId,
};

await stripe.checkout.sessions.create({
  mode: 'subscription',
  line_items: [{ price: 'price_monthly', quantity: 1 }],
  success_url:
    'https://your-site.com/thanks?session_id={CHECKOUT_SESSION_ID}',
  metadata,
  subscription_data: { metadata },
});

Stripe exposes Checkout metadata on Checkout events and subscription metadata on Subscription events. For invoices created by a subscription, Stripe places that metadata under the invoice's subscription details. Talivia reads both the current parent.subscription_details.metadata shape and the earlier subscription_details.metadata shape.

Connect the customer identity

Call identify when the customer logs in, signs up, or reaches the authenticated product.

Link a Talivia visitor to Stripe
window.talivia.identify('user_123', {
  email: currentUser.email,
  stripeCustomerId: currentUser.stripeCustomerId,
});

Talivia can then attribute a renewal through the Stripe customer even though the renewal happens without a new browser checkout session.

Events Talivia maintains

The managed Stripe webhook receives:

  • successful and failed invoice payments;
  • subscription creation, updates, cancellation, pause, resume, trials, and pending updates;
  • successful refunds and refund updates;
  • dispute creation, updates, closure, and funds movements.

Initial Checkout and invoice events can arrive in either order. Talivia reconciles them into one payment using the Payment Intent, Checkout Session, customer, amount, and event time instead of counting the signup twice.

Stripe Payment Intents

Attribute direct Payment Intents used by custom checkout, Elements, or mobile payment flows.

Other Stripe methods

Attribute revenue when Stripe is behind another billing layer or the checkout cannot pass Talivia metadata directly.