# Glitchless for Stripe

> Glitchless (glitchless.gg) connects the Stripe account a web or PC game sells through: revenue, refunds, disputes, fees and net by day, revenue by product and country, new paying customers, and revenue by version next to the crashes and frame times it measured. Read only, with a restricted key.

Website: https://www.glitchless.gg/stripe.html · Read how it works: https://github.com/glitchless-gg/glitchless/blob/main/docs/SPEC.md#3i-revenue-stripe-glitchless-cloud

Connect the Stripe account your web or PC game sells through and its sales sit next to how the game runs: revenue, refunds and fees by day and by product. Add one line to your checkout and revenue splits by version too, beside each version's crashes and frame times. Your coding agent reads the same numbers.

## What you get: a Revenue page

- **Revenue, and what's left.** Revenue and payments by day, with refunds, disputes, Stripe's fees and the net, in the currency your account settles in.
- **Revenue per player.** That revenue divided by the players Glitchless measured in the same days.
- **Refunds and disputes.** How much was refunded or disputed, how many refunds, and their share of revenue.
- **New paying customers.** First-time buyers next to the new players Glitchless saw. A buyer is counted by a hash, never their name or email.
- **Revenue by product.** Each product's revenue, payments and refunds, so you can see which DLC sells and which gets refunded.
- **Revenue by version.** When your checkout carries the player's Glitchless session ID, each purchase joins the session it came from: revenue by version and platform, next to that version's crash-free sessions and frame-time p95, and how many players paid. A world map of revenue by country is a panel you can add too.

## Connect it

In Glitchless Cloud. A restricted, read-only key, plus one optional line for revenue by version.

1. In Stripe, go to **Developers → API keys → Create restricted key**. Set **Balance transaction sources** and **Checkout Sessions** to Read and leave everything else at None. Add **Products: Read** only if you'll pick your game's products by metadata.
2. In Glitchless, open **Integrations**, choose **Add integration**, then **Stripe**. Paste the key, and your game's products if the account sells other things too.
3. Press **Sync now**. It reads back as far as your plan keeps data, then syncs every hour, and a Revenue page joins your dashboard.

Optional: revenue by version:

```js
// in the game (the Glitchless SDK): send it with the purchase request
const sessionId = Glitchless.instance.sessionId;

// on your server, creating the Checkout Session
stripe.checkout.sessions.create({ ..., client_reference_id: sessionId });
```

## What your agent does with it

`glitchless_revenue` gives your agent the account's revenue by day with refunds, disputes, fees and net, new paying customers, revenue by product and by country, and revenue by version and platform for the purchases tied to a session, all next to the players Glitchless measured. Ask it whether 1.4.2 earns more per player than 1.4.1, or where the refunds jumped.

A game that also sells through [RevenueCat](https://www.glitchless.gg/revenuecat.md) gets both: a Revenue page for each, and `glitchless_revenue` reports both unless you ask for one. With no RevenueCat, your weekly summary's revenue line comes from Stripe, and never from a test-mode key.

## What it never does

- Change anything in your Stripe account: every call is a read, and no webhook is used.
- Take a secret key. An `sk_…` key can do anything in your account, so it's refused before anything is sent, and so are publishable keys and webhook secrets.
- Show the key again: it's encrypted when it arrives, and the dashboard keeps only its last four characters and whether it's live or test.

## Not yet

- Subscription renewals count as revenue but can't name a product, and neither can payments your game takes without Checkout. Both show as "Not through Checkout".
- Payments that settle in a second currency are counted apart and left out, never converted.
- Revenue by version covers only the purchases your checkout tied to a session, over 31 days or less.

## Frequently asked questions

### Can I try it in test mode first?

Yes. Make the restricted key in test mode (`rk_test_…`) and it reads test payments only. It says **Stripe (test mode)** on every panel and on the Integrations page, and the weekly summary never uses it. A live key only ever reads live payments.

### My Stripe account sells other things too. What counts?

Everything, unless you pick the game's products when you connect: their IDs (`prod_…`), or one metadata key they share, like `game=caverun`. Then only Checkout and Payment Link payments for those products count, a bundle with something else counts in part, and refunds and disputes count for their share of the payment. Picking by metadata needs **Products: Read** on the key.

### How are refunds counted?

On the day Stripe processed them, in the account's settlement currency. Revenue stays gross: refunds and disputes are shown beside it, and the net is what's left after them and Stripe's fees. Revenue by product shows each product's refunds too.

### Is this the Stripe account Glitchless bills me from?

No. It reads your game's own account with your key. Glitchless's billing is a separate account, and neither ever sees the other's keys.

### How often does it sync, and which plans include it?

Every hour, on every Glitchless Cloud plan including Free. The first sync reads back as far as your plan keeps data: 14 days on Free, 90 on Indie, 400 on Studio. **Sync now** runs one straight away.
