Custom Integration
When the pre-built integrations do not fit your setup, you can build your own with the Cryptlex Web API and connect it to any payment processor, CRM, or third-party app. The most common case is automating order fulfillment: when a payment succeeds, your server creates a user and generates a license, then delivers the license key to your customer.
This guide shows the exact endpoints involved. For the complete request and response schema of each endpoint, including every optional field, see the Web API reference.
How it works
- Your payment processor calls your server endpoint (a webhook) on a successful payment.
- Your server calls the Cryptlex Web API to create a user and a license.
- Your server (or an automated email) delivers the license key to the customer.
Authentication
All Web API requests are authenticated with a personal access token sent in the Authorization header. Create the token in the admin portal and store it as a secret on your server, never in client code.
Authorization: Bearer YOUR_ACCESS_TOKENThe base URL for all endpoints is https://api.cryptlex.com/v3. If your account is in the EU region, use https://api.eu.cryptlex.com/v3 instead.
Step 1: Create a user
Create a user from the customer details supplied by your payment processor. This is required if you want the customer to access the customer portal, and mandatory for the named user licensing model.
POST https://api.cryptlex.com/v3/users
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
{
"firstName": "Jane",
"lastName": "Doe",
"email": "jane@example.com",
"role": "user"
}The response contains the new user's id, which you use to link the license in the next step.
Step 2: Generate a license
Create a license under your product. Pass a licenseTemplateId so the license inherits that template's configuration (subscription interval, activation limits, type, and so on), and set userId to link it to the user created above.
POST https://api.cryptlex.com/v3/licenses
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
{
"productId": "YOUR_PRODUCT_ID",
"licenseTemplateId": "YOUR_LICENSE_TEMPLATE_ID",
"userId": "USER_ID_FROM_STEP_1"
}The response contains the generated license key, which is what your customer uses to activate your app.
Step 3: Deliver the license key
Send the license key to your customer using either of the following:
- Configure an automated email so Cryptlex emails the key on license creation.
- Use webhooks to trigger your own mail script or a third-party service such as SendGrid or Mailgun.
Custom development
Prefer to have it built for you? Our team can write the integration and automation scripts to connect Cryptlex with your payment processor, CRM, or other third-party apps. Send us the details through the contact page and we will get it done in minimum time at a nominal cost.
Need more help?
If you need help building your integration, contact us through the contact page.