Prerequisites
- A Stripe account (test or live)
- Your Atrium instance running at a publicly accessible HTTPS URL
Setup
1
Get your Stripe secret key
Log in to the Stripe Dashboard.
- For test mode: copy the key starting with
sk_test_... - For live mode: copy the key starting with
sk_live_...
rk_test_... / rk_live_...) if you prefer to limit the key’s permissions.2
Set your API URL
Stripe needs to reach your Atrium instance to deliver webhook events. Make sure Restart Atrium after changing environment variables.
API_URL in your .env file is set to your public HTTPS URL:3
Enter the key in Atrium
- Log in to the Atrium dashboard as an owner.
- Go to Settings → System.
- Scroll to the Client Payments section.
- Enter your Stripe secret key in the input field and click Save & Connect.
Environment variables
Direct Keys mode requires only one environment variable:STRIPE_CONNECT_CLIENT_ID, etc.) are needed for Direct Keys mode.
What Atrium does automatically
When you save your key, Atrium:- Verifies the key by calling Stripe’s API
- Creates a webhook endpoint at
https://<API_URL>/api/payments/webhook/<orgId>on your Stripe account, listening forcheckout.session.completedandcheckout.session.expired - Stores the webhook signing secret in your database (encrypted)
Local development
Stripe cannot deliver webhooks tolocalhost. Use a tunnel to expose your local API:
- cloudflared
- ngrok
https://abc123.trycloudflare.com) and set it as API_URL in your .env, then enter your Stripe key in settings. The webhook endpoint will be registered pointing to the tunnel URL.
Keep the tunnel running while testing. If you restart the tunnel and get a new URL, you’ll need to remove and re-add your Stripe key so Atrium can register a new webhook at the updated URL.
Troubleshooting
"Failed to register webhook on your Stripe account"
"Failed to register webhook on your Stripe account"
Your
API_URL is not publicly accessible from Stripe’s servers.Check:API_URLstarts withhttps://(nothttp://orlocalhost)- The URL resolves from the public internet (test with
curl https://your-atrium-domain.com/api/health) - Your firewall or hosting provider allows inbound HTTPS traffic
Invoice paid but still shows as overdue
Invoice paid but still shows as overdue
The webhook did not fire or failed signature verification.Check:
- In Stripe Dashboard, go to Developers → Webhooks → your endpoint → Recent deliveries and look for failed events.
- Confirm
API_URLmatches the URL where Atrium is actually running. - If you changed
API_URLafter initial setup, remove and re-save your Stripe key to register a fresh webhook.
"Invalid Stripe key"
"Invalid Stripe key"
Atrium validates the key against Stripe’s API when you save it. This error means the key is incorrect or has been revoked.Verify the key in your Stripe Dashboard and ensure you copied the full value including the
sk_test_ or sk_live_ prefix."Online payments are not configured" shown to clients
"Online payments are not configured" shown to clients
No Stripe key has been saved yet (or the key was removed). Go to Settings → System → Client Payments and enter your key.