# How to connect Stripe for game sales and subscriptions

> Connect Stripe to record invoices, one-time Checkout payments, refunds and subscriptions as revenue, linked to the player who paid and the channel behind them.

By Yos Riady. Updated 2026-11-22. Published 2026-11-22. Canonical URL: https://manalens.dev/integrations/stripe

Connect Stripe to record each sale and refund from your Stripe account as revenue in Manalens. A signed webhook sends invoices, one-time Checkout payments, direct payments, refunds and subscriptions, and a read key checks once a day that nothing was missed. Put your player ID in the checkout, and revenue shows by channel, campaign and player.

## Key takeaways

- A signed Stripe webhook records invoices, one-time Checkout payments, direct payments, refunds and subscriptions as revenue.
- A one-time Checkout payment counts with no invoice, and one sale is counted once, even after webhook retries.
- Put an opaque player ID as user_id in the Stripe metadata, or use client_reference_id on a Checkout Session, to link revenue to the player.

## How do I connect Stripe?

You need the owner or admin role and a verified MFA session. Use your live Stripe account: test keys are refused and test mode events are ignored.

1. In Manalens, open Settings, Integrations, Stripe, and click Create webhook URL.
2. In the Stripe Dashboard, add a webhook endpoint with that URL. Select invoice.paid, checkout.session.completed, checkout.session.async_payment_succeeded, payment_intent.succeeded, charge.refunded, customer.subscription.created, customer.subscription.updated and customer.subscription.deleted.
3. Create a restricted key with read access to Invoices, Charges, Subscriptions, Checkout Sessions and PaymentIntents.
4. Paste the webhook signing secret and the restricted key in Manalens, then click Connect Stripe. The first sync reads the last 7 days and every current subscription.

## Which Stripe payments count?

One sale is counted once. Webhook retries and the daily sync of the same payment keep one row.

- Invoices: invoice.paid records the amount paid. This covers subscriptions, invoices you send, and Checkout with invoice creation on.
- One-time Checkout payments: a paid Checkout Session in payment mode, also from a Payment Link, with no invoice. You do not need to turn on invoice creation.
- Direct payments: a payment with no Checkout and no invoice, such as a custom Payment Element flow, from payment_intent.succeeded.
- Refunds: charge.refunded records a full or partial refund as a negative amount.

## How do I link Stripe payments to players?

Use one opaque player ID, not an email, in your analytics and in the checkout. Put it as user_id in the metadata of the object that the webhook reads: the Checkout Session, the invoice or the subscription. A Checkout Session with no metadata user_id uses its client_reference_id. Or send the identify trait stripe_customer_id from the game.

On a Payment Link, the buyer can change client_reference_id in the URL. When the player ID must come from your server, create the Checkout Session on your server and set metadata user_id.

*Node.js, on your server*

```javascript
// A one-time sale. No invoice is needed.
const session = await stripe.checkout.sessions.create({
  mode: 'payment',
  line_items: [{ price: 'price_supporter_pack', quantity: 1 }],
  client_reference_id: 'player_8f3k2', // read when metadata has no user_id
  metadata: { user_id: 'player_8f3k2' },
  success_url: 'https://example.com/thanks',
});
```

## How do I check the Stripe connection?

A green check shows next to Stripe when the integration is connected. Make a small real purchase and refund it. Then check both rows in Activity, and the revenue on the player profile.

## Frequently asked questions

### Do I need Stripe invoices for one-time game sales?

No. Manalens records a paid one-time Checkout Session from checkout.session.completed, with no invoice, also when it comes from a Payment Link. A delayed method such as a bank debit is recorded from checkout.session.async_payment_succeeded. If you turn on invoice creation, the sale is recorded once, from invoice.paid.

### Can I test with Stripe test mode?

No. Test keys are refused and test mode events are ignored, so test data never mixes with real revenue. Connect your live account, make a small real purchase, then refund it. Check that the sale and the refund both show in Activity and on the player profile.

### How does Manalens know which player paid?

From a user_id in the Stripe metadata of the Checkout Session, invoice or subscription, or from client_reference_id on a Checkout Session. You can also send the identify trait stripe_customer_id from the game. Use an opaque player ID, not an email, so the same ID links the game and the payment.

### What happens when I disconnect Stripe?

Click Disconnect in Settings, Integrations, Stripe. Manalens removes the signing secret and the read key, and stops taking webhooks and daily syncs. Revenue that is already recorded stays in your reports. Then delete the webhook endpoint in the Stripe Dashboard, so Stripe stops sending events.

## Sources

- [Stripe documentation: Receive Stripe events in your webhook endpoint (read 22 November 2026)](https://docs.stripe.com/webhooks)
- [Stripe documentation: Restricted API keys (read 22 November 2026)](https://docs.stripe.com/keys/restricted-api-keys)
- [Stripe documentation: Create a Checkout Session (read 22 November 2026)](https://docs.stripe.com/api/checkout/sessions/create)
- [Stripe documentation: Metadata (read 22 November 2026)](https://docs.stripe.com/metadata)

## Related guides

- [Example project: with-stripe](https://github.com/manalens/examples/tree/main/with-stripe)
- [Stripe setup in the documentation](https://docs.manalens.dev/integrations/stripe)
- [Revenue reports](https://docs.manalens.dev/features/revenue)
- [How to track Stripe and Paddle game sales](https://manalens.dev/blog/track-stripe-paddle-game-sales)
- [Sell your game direct: your own store, Patreon or Stripe](https://manalens.dev/blog/sell-your-game-direct)
- [Connect Paddle](https://manalens.dev/integrations/paddle)
- [Track an HTML5 or Three.js game](https://manalens.dev/integrations/html5)
