Webhook Signature Verification
Error: No signature header found
Error: No signature header found
Error Messages:
No stripe-signature header was found.No x-fs-signature header was found.No Paddle-Signature header was found.
- Verify webhook is configured correctly in your payment platform dashboard
- Ensure you’re sending the webhook to the correct endpoint
- Check that your payment platform account has webhooks enabled
- For testing, verify your HTTP client is forwarding all headers
Error: Signature verification failed
Error: Signature verification failed
Error Messages:
The payload is tampered(FastSpring)Paddle webhook signature verification failed.- Stripe signature verification errors
-
Verify webhook secret is correct:
- Stripe: Check
STRIPE_WEBHOOK_SECRETmatches your Stripe dashboard - FastSpring: Verify
FASTSPRING_WEBHOOK_SECRETmatches your webhook configuration - Paddle: Confirm
PADDLE_WEBHOOK_SECRETis set correctly
- Stripe: Check
-
Check for payload modification:
- Ensure no middleware is modifying the request body before verification
- Don’t parse JSON before signature verification
- Use raw body for verification
-
Environment variable issues:
Error: Webhook secret not found in environment variables
Error: Webhook secret not found in environment variables
Error Messages:
STRIPE_WEBHOOK_SECRET was not found in environment variables.FASTSPRING_WEBHOOK_SECRET was not found in environment variables.PADDLE_WEBHOOK_SECRET was not found in environment variables.
-
Create a
.envfile with all required variables: -
For Cloudflare Workers, set secrets via dashboard or CLI:
-
Verify environment variables are loaded at runtime:
Cryptlex API Errors
Error: CRYPTLEX_ACCESS_TOKEN not found
Error: CRYPTLEX_ACCESS_TOKEN not found
Error Message:
CRYPTLEX_ACCESS_TOKEN was not found in environment variables.Cause:
The Cryptlex API access token is not configured.Solutions:-
Generate an access token in your Cryptlex dashboard:
- Go to Settings → Access Tokens
- Create a new token with appropriate permissions
- Copy the token value
-
Add to environment variables:
-
Ensure token has required permissions:
- Read/Write users
- Read/Write licenses
- Read license templates
Error: User creation/search failed
Error: User creation/search failed
Error Messages:3. Missing required fields:4. API permissions:
User search failed: [error message]User creation failed: [error message]User updation failed: [error message]
- This is expected behavior - the code handles this with
checkUserExists - Verify
insertUserorupsertUseris being used (notcreateUserdirectly)
- Check that email from payment platform is valid
- Add validation before user creation:
- Ensure
customerNameis not empty - Use fallback values:
- Verify access token has user management permissions
- Check API base URL is correct
Error: License creation failed
Error: License creation failed
Error Messages:4. Invalid subscription interval:
License creation failed with error: [code] [message]No license template foundProduct not found
- Verify
CRYPTLEX_PRODUCT_IDmatches your Cryptlex product - Check product ID in Cryptlex dashboard
- Ensure product is active
- Verify license template exists in Cryptlex
- Check template ID in payment platform product metadata
- Ensure template is active
- Ensure user is created before license
- Verify userId is not null:
- Use ISO 8601 duration format:
P1M,P1Y,P1W, etc. - Use empty string
""for perpetual licenses
- Check your Cryptlex account license limits
- Review pricing plan restrictions
Error: No license found with subscriptionId
Error: No license found with subscriptionId
Error Message:
No license found with subscriptionId: [id]Cause:
Renewal or suspension event fired, but no license exists with that subscription ID in metadata.Solutions:-
Verify metadata key is correct:
- Stripe:
subscription_id - FastSpring:
subscription_id - Paddle:
paddle_subscription_id
- Stripe:
-
Check license was created successfully:
- Review logs for initial purchase event
- Verify subscription ID was saved in metadata during creation
-
Manually add subscription ID to license:
- Find license in Cryptlex dashboard
- Add metadata key-value pair with subscription ID
-
Check for timing issues:
- License creation webhook may have failed
- Renewal webhook may have arrived before creation completed
- Implement retry logic or idempotency
Webhook Event Handling
Error: Webhook with event type [type] is not supported
Error: Webhook with event type [type] is not supported
Error Message:
Webhook with event type checkout.session.async_payment_succeeded is not supported.Cause:
The integration received a webhook event type it doesn’t handle.Solutions:-
Add handler for the event:
- Implement handler function
- Add case to switch statement in
app.ts - Update event type list in payment platform dashboard
-
Filter events in payment platform:
- Only subscribe to supported events
- Review Webhook Events Reference
-
Return 200 for unsupported events:
- See complete list in Webhook Events Reference
Error: Customer email not found
Error: Customer email not found
Error Messages:
Customer email not found in invoice with ID: [id]Customer email not found in checkout session [id]Customer email is required
-
Check multiple email fields:
-
Require email in checkout:
- Stripe: Set
billing_address_collection: 'required' - Enable email collection in checkout settings
- Stripe: Set
-
Fetch customer details:
Race condition: Multiple webhooks creating same user
Race condition: Multiple webhooks creating same user
Issue:
Two webhook events fire simultaneously, both trying to create the same user.Symptoms:Best Practices:
- User creation error followed by successful operation
- Duplicate user creation attempts in logs
insertUser and upsertUser functions handle this:- Always use
insertUserorupsertUser(notcreateUserdirectly) - Implement idempotency keys for critical operations
- Log event IDs to track duplicate processing
Deployment Issues
Cloudflare Workers deployment fails
Cloudflare Workers deployment fails
Common Issues:1. Binding errors:
- Update
wrangler.tomlwith correct service bindings - Set environment variables via dashboard or CLI
- Optimize dependencies
- Use external modules
- Split into multiple workers
CORS errors when testing webhooks
CORS errors when testing webhooks
Error:
Access-Control-Allow-Origin header missingNote:
CORS is not relevant for server-to-server webhooks from payment platforms.Solutions:- For payment platform webhooks: No CORS needed (server-to-server)
-
For browser testing:
-
Use proper webhook testing tools:
- Stripe CLI:
stripe listen --forward-to localhost:3000/stripe/v1 - Webhook.site for inspection
- Payment platform test modes
- Stripe CLI:
Debugging Tips
Enable Detailed Logging
Test Webhook Signatures Locally
Verify API Connectivity
Check Event Processing Order
Getting Help
If you’re still experiencing issues:- Check the Webhook Events Reference for supported events
- Review User Actions and License Actions documentation
- Enable detailed logging and check error messages
- Verify all environment variables are set correctly
- Test with payment platform webhooks in test mode first
- Contact Cryptlex support with:
- Event ID
- Full error message
- Relevant logs
- Environment configuration (without secrets)