Prerequisites
- A Stripe account, and permission to create restricted keys and webhook endpoints in it.
- Product analytics available for the project. See Product analytics.
- A Squasher API key with the
providers:writepermission, if you connect with the CLI or the API. See API keys.
Create a restricted key
- In the Stripe Dashboard, open Developers, then API keys, and create a restricted key.
- Give the key Read access to these resources. Leave every other resource at None.
- Copy the key. It starts with
rk_live_(orrk_test_in test mode). Squasher refuses secret keys (sk_), because it only reads.
Connect Stripe
- CLI
- API
The CLI reads the key from the The command prints the webhook URL and the event types to select.
STRIPE_RESTRICTED_KEY environment variable or from stdin. It has
no flag for the key, so the key does not stay in your shell history.Add the webhook endpoint
- In the Stripe Dashboard, open Developers, then Webhooks, and add an endpoint.
- Paste the webhook URL from the connect step. Use API version
2024-06-20or earlier for the endpoint, so invoice events include the paying charge. - Select these events:
charge.succeeded,charge.captured,charge.updated,charge.refunded,charge.refund.updated,refund.created,refund.updated,charge.dispute.funds_withdrawn,charge.dispute.funds_reinstated,invoice.paid,customer.subscription.created,customer.subscription.updated,customer.subscription.deleted,customer.subscription.paused,customer.subscription.resumed,checkout.session.completed,customer.created, andcustomer.updated. - Copy the signing secret of the endpoint (it starts with
whsec_) and save it in Squasher:
Check the connection
Disconnect Stripe
Next steps
Revenue
How Squasher counts revenue and MRR, and how revenue links to people.
Revenue API
Read revenue and MRR from your own tools.