What you'll need
A Stripe account with access to the API keys page, and permission to create a restricted key. Not your main secret key; Stripe rejects it here on purpose (see Troubleshooting).
Steps
- 1In your Stripe Dashboard, go to Developers → API keys.
- 2Click Create restricted key.
- 3Name it something identifiable, e.g. "thexly-readonly".
- 4Set exactly two permissions, everything else stays at None:
- Checkout Sessions: Read
- Webhooks: Write
- 5Click Create key, and complete the two-factor prompt if asked.
- 6Copy the key immediately: Stripe only shows it once. It starts with
rk_live_(orrk_test_in test mode). - 7Paste it into Thexly under Settings → Payments → Stripe.
What Thexly does with this connection
Thexly reads your completed Checkout Sessions and matches them against the sessions your tracking script captured; see how Thexly assigns revenue to a channel for the full mechanism. Going forward, Stripe pushes events to the webhook Thexly registers for you; Thexly doesn't need to keep polling the API. Nothing is ever written back to your Stripe account beyond that one webhook registration, and the key never has write access to payments, customers, or anything else.
If a checkout happens through a static Payment Link, Thexly's tracking script automatically appends the visitor's session to the link before they click it, no code change needed on your side. If you create Checkout Sessions or Payment Intents yourself (server-side), pass the visitor's current session as client_reference_id (or in metadata.thexly_session_id) so the payment can be matched. Call window.thexly.getSessionId() from your checkout page to get it.
Troubleshooting
- "Invalid API key" on save: you likely pasted a secret key (
sk_) or publishable key (pk_) instead of the restricted key. Onlyrk_keys are accepted. - Payments not appearing after connecting: double-check the key has Read on Checkout Sessions. A key saved with the wrong permissions won't error on connection, it'll just return nothing.
- Key stopped working: someone may have rolled or deleted it in the Stripe dashboard. Create a new restricted key with the same two permissions and reconnect.
What's next
Once connected, head back to Verify it's working and confirm a test payment shows up in your dashboard.