Stripe
This guide walks you through integrating Stripe with Cryptlex to automate license creation and subscription renewals. The integration supports both one-time purchases and subscriptions.
Prerequisites
- Complete the Cryptlex Quick Start Guide to set up your product and license templates.
- Deploy the Stripe-Cryptlex integration script using one of the following options:
- Self-hosted: Follow our deployment guide to run the integration on your infrastructure.
- Cryptlex-hosted: Let Cryptlex host the integration for a nominal fee. Contact us through the contact page to request managed hosting.
Step 1: Set up products in Stripe
In your Stripe Dashboard:
- Navigate to
Productsand create your desired product(s). - Add the following metadata keys to the Stripe checkout session (both are required):
CRYPTLEX_PRODUCT_IDCRYPTLEX_LICENSE_TEMPLATE
Step 2: Configure webhooks
- In your Stripe Dashboard, go to
Developers -> Webhooks. - Click
Add Endpoint, and enter the URL where your integration script is hosted. - Select the following events to listen for:
checkout.session.completed: Triggers license creation after successful checkout.invoice.paid: Triggers license creation and also handles subscription renewals.customer.created: Creates the corresponding user in Cryptlex.
- Retrieve the signing secret and provide it to your integration script for webhook verification.
What happens next
Once the integration is active:
- New licenses are automatically created after successful Stripe payments.
- New users are created in Cryptlex using the customer's name and email from Stripe, and are automatically linked to the corresponding license.
- Licenses are automatically renewed in Cryptlex when the corresponding Stripe subscription renews.
Need more help?
If you need help with the Stripe integration, contact us through the contact page.
Last updated: