DEV Community

Olivier Moussalli
Olivier Moussalli

Posted on

Automated License Distribution: From Purchase to Activation in 60 Seconds

Your customer clicks "Buy Now" at 2 AM. What happens next?

Manual process: You wake up, check email, generate license key, copy-paste into email, send to customer. Time: 8+ hours (when you wake up).

Automated process: License key generated instantly, emailed to customer automatically. Customer activates within 60 seconds. Time: < 1 minute.

This guide shows you how to implement fully automated license distribution with Quick License Manager, eliminating manual work and delivering instant customer satisfaction.

The business case: Manual license delivery costs you sales. Every hour of delay = 10-15% drop in activation rate. Automation = instant delivery = 95%+ activation rate.


The Cost of Manual License Distribution

Typical manual workflow:

  1. Customer purchases (any time, any day)
  2. E-commerce platform sends order confirmation
  3. Vendor manually generates license key (during business hours)
  4. Vendor manually emails license (subject to human error)
  5. Customer receives license (hours or days later)
  6. Customer activates

Problems:

Delays: Customers wait hours/days for license

Errors: Wrong product, typos in email, wrong customer

Lost sales: Customers forget, lose interest, request refund

Support burden: "Where's my license?" tickets

24/7 impossible: Someone must be available to generate licenses

Scaling: Can't handle 100+ orders/day manually

Cost of delays:

  • 1 hour delay = 10% drop in activation
  • 24 hour delay = 40% drop in activation
  • 1 week delay = 70% drop in activation

Real numbers: 1,000 orders/month × $50 average × 40% lost = $20,000/month lost revenue


The Automated Solution

What happens when customer clicks "Buy Now":

  1. ✅ Customer purchases (FastSpring, Stripe, etc.)
  2. ✅ E-commerce platform webhooks QLM License Server
  3. ✅ QLM generates license key automatically (< 1 second)
  4. ✅ QLM stores customer data in database
  5. ✅ E-commerce platform emails license to customer
  6. ✅ Customer receives email within 60 seconds
  7. ✅ Customer activates immediately

Benefits:

Instant delivery: < 60 seconds purchase → activation

Zero errors: No human involvement = no mistakes

24/7 operation: Works while you sleep

Unlimited scale: Handle 1,000+ orders/day

95%+ activation rate: No delays = happy customers

Zero support tickets: "Where's my license?"

Subscription automation: Renewals happen automatically

ROI: Automation pays for itself in the first month.


Supported E-Commerce Platforms

Quick License Manager integrates with 12 major platforms:

WooCommerce (WordPress e-commerce)

FastSpring (digital products)

2checkout (global payments)

Stripe Checkout (credit cards)

PayPal (worldwide)

Shopify (general e-commerce)

Chargify (subscription billing)

HubSpot (CRM + e-commerce)

Cleverbridge (software commerce)

BlueSnap (global payments)

MyCommerce (Digital River)

UltraCart (shopping cart)

Integration guides: E-Commerce Integration


How Webhooks Work

Understanding Webhooks

Webhook = reverse API call

Traditional API: Your server calls e-commerce platform

Webhook: E-commerce platform calls your server

When webhooks fire:

  • ✅ New order placed
  • ✅ Subscription renewed
  • ✅ Subscription cancelled
  • ✅ Refund issued
  • ✅ Payment failed

QLM Webhook Handler

QLM provides a webhook endpoint that e-commerce platforms call:

https://yourserver.com/qlmservice.asmx/QlmWebHookHandler
Enter fullscreen mode Exit fullscreen mode

What it does:

  1. Receives order data from e-commerce platform
  2. Validates webhook signature (security)
  3. Parses customer info (email, name, order ID)
  4. Identifies product purchased
  5. Generates appropriate license key
  6. Stores everything in database
  7. Returns license key to e-commerce platform
  8. E-commerce platform emails customer

Your code: 0 lines. It's all built-in.


FastSpring Integration (Step-by-Step)

Setup Process

Step 1: Configure QLM

// In QLM Management Console:
// 1. Go to Manage Keys → 3rd Party Extensions
// 2. Click "Add"
// 3. Select "FastSpring"
// 4. Set credentials:
//    - User: your_api_user
//    - Password: your_api_password
//    - Shared Key: your_hmac_secret (for security)
// 5. Save
Enter fullscreen mode Exit fullscreen mode

Step 2: Create Product in FastSpring

  1. Login to FastSpring dashboard
  2. Products → Create New Product
  3. Set product details:
    • Name: "MyApp Professional License"
    • Price: $99
    • License type: Digital product

Step 3: Configure Webhook in FastSpring

Webhooks → Create Webhook

URL: https://yourserver.com/qlmLicenseServer/qlmservice.asmx/QlmWebHookHandler?is_vendor=fastspring&is_user=your_user&is_pwd=your_pwd

Events to send:
☑ order.completed
☑ subscription.activated
☑ subscription.charge.completed
☑ subscription.charge.failed
☑ return.created

HMAC Secret: (copy from QLM 3rd Party Extensions)
Enter fullscreen mode Exit fullscreen mode

Step 4: Add License Generation Fulfillment

In FastSpring Product → Fulfillment:

Add Fulfillment Action → Generate License

Option 1: Remote Server Request (Recommended)
URL: https://yourserver.com/qlmLicenseServer/qlmservice.asmx/GetActivationKey?is_vendor=fastspring&is_productid=1&is_majorversion=1&is_minorversion=0&is_qlmversion=5.0.00&is_user=abc&is_pwd=def&is_features=0:3&is_licensemodel=permanent

Option 2: Script (PHP/JavaScript)
[QLM provides pre-built scripts]

Output: Single-Line License
License Name: {{order.customer.email}}
Enter fullscreen mode Exit fullscreen mode

Step 5: Configure Email Template

FastSpring email to customer:

Subject: Your MyApp License Key

Hi {{order.customer.first}},

Thank you for purchasing MyApp!

Your license key: {{licenses}}

To activate:
1. Download MyApp: https://myapp.com/download
2. Open MyApp
3. Enter your license key when prompted
4. Click "Activate"

Need help? Reply to this email.

Best regards,
MyApp Team
Enter fullscreen mode Exit fullscreen mode

Step 6: Test

  1. Place test order in FastSpring
  2. Check QLM Management Console → Manage Keys
  3. Verify license was created
  4. Verify email was sent
  5. Test activation in your app

Tutorial: FastSpring Integration


Stripe Integration

Stripe Checkout + Webhooks

Step 1: Configure QLM

// QLM Management Console:
// Manage Keys → 3rd Party Extensions → Stripe
// Set API credentials from Stripe Dashboard
Enter fullscreen mode Exit fullscreen mode

Step 2: Create Product in Stripe

# Using Stripe CLI or Dashboard
stripe products create \
  --name "MyApp Professional" \
  --description "Professional license for MyApp"

stripe prices create \
  --product prod_xxxxx \
  --unit_amount 9900 \
  --currency usd
Enter fullscreen mode Exit fullscreen mode

Step 3: Configure Webhook Endpoint

Stripe Dashboard → Developers → Webhooks → Add Endpoint

Endpoint URL: https://yourserver.com/qlmLicenseServer/qlmservice.asmx/QlmWebHookHandler?is_vendor=stripe

Events to send:
☑ checkout.session.completed
☑ invoice.paid
☑ invoice.payment_failed
☑ customer.subscription.created
☑ customer.subscription.deleted

Webhook signing secret: whsec_xxxxx (save in QLM)
Enter fullscreen mode Exit fullscreen mode

Step 4: Handle in Your App

// When customer clicks "Buy Now" button
public void InitiateCheckout()
{
    var options = new SessionCreateOptions
    {
        PaymentMethodTypes = new List<string> { "card" },
        LineItems = new List<SessionLineItemOptions>
        {
            new SessionLineItemOptions
            {
                Price = "price_xxxxx",
                Quantity = 1,
            },
        },
        Mode = "payment",
        SuccessUrl = "https://myapp.com/success?session_id={CHECKOUT_SESSION_ID}",
        CancelUrl = "https://myapp.com/cancel",
        CustomerEmail = userEmail,
        Metadata = new Dictionary<string, string>
        {
            { "qlm_product_id", "1" },
            { "qlm_version", "1.0" }
        }
    };

    var service = new SessionService();
    Session session = service.Create(options);

    // Redirect to Stripe Checkout
    Response.Redirect(session.Url);
}
Enter fullscreen mode Exit fullscreen mode

What happens automatically:

  1. Customer completes Stripe Checkout
  2. Stripe sends webhook to QLM
  3. QLM generates license key
  4. QLM stores in database
  5. Your success page retrieves license from QLM
  6. You email license to customer (or show on page)

Subscription Automation

Auto-Renewal Workflow

Perfect for SaaS products - 100% automated, no code required.

How it works:

Initial subscription:

  1. Customer purchases subscription via e-commerce platform
  2. E-commerce platform sends webhook to QLM
  3. QLM creates license with expiry date (e.g., 1 month)
  4. Customer activates license in app

Automatic renewal:

  1. E-commerce platform charges customer monthly
  2. Payment succeeds → webhook fires
  3. QLM automatically extends license expiry (no code needed)
  4. Customer app continues working seamlessly

Payment failure:

  1. E-commerce platform sends payment_failed webhook
  2. QLM doesn't extend license
  3. License expires on schedule
  4. Customer app shows "subscription expired"
  5. Customer updates payment → automatic retry

Grace periods:

Configure in QLM Server Properties:

subscriptionGracePeriod = 7
Enter fullscreen mode Exit fullscreen mode

Your app checks expiry:

public bool ValidateSubscription()
{
    var lv = new LicenseValidator("settings.xml");

    if (lv.QlmLicenseObject.LicenseModel == ELicenseModel.subscription)
    {
        DateTime expiryDate = lv.QlmLicenseObject.ExpiryDate;

        if (DateTime.Now > expiryDate)
        {
            int daysOverdue = (DateTime.Now - expiryDate).Days;

            if (daysOverdue <= 7)
            {
                // Within grace period - show warning but allow use
                ShowGracePeriodWarning(7 - daysOverdue);
                return true;
            }
            else
            {
                // Grace period expired
                ShowSubscriptionExpired();
                return false;
            }
        }
    }

    return true;
}
Enter fullscreen mode Exit fullscreen mode

The e-commerce platform handles all subscription logic automatically:

  • ✅ Charging customers
  • ✅ Retrying failed payments
  • ✅ Sending renewal reminders
  • ✅ Notifying QLM via webhooks
  • ✅ Extending license expiry dates

You configure once, it runs forever.

More details: Trial Implementation


Multi-Product Catalog

Different Products → Different Licenses

Scenario: You sell Basic, Pro, and Enterprise editions.

FastSpring setup:

Product 1: MyApp Basic ($49)
→ QLM: productID=1, features=0:1 (Basic feature)

Product 2: MyApp Pro ($99)  
→ QLM: productID=1, features=0:2 (Pro features)

Product 3: MyApp Enterprise ($299)
→ QLM: productID=1, features=0:4 (Enterprise features)
Enter fullscreen mode Exit fullscreen mode

Fulfillment URLs:

Basic:
/GetActivationKey?is_productid=1&is_features=0:1&is_licensemodel=permanent

Pro:
/GetActivationKey?is_productid=1&is_features=0:2&is_licensemodel=permanent

Enterprise:
/GetActivationKey?is_productid=1&is_features=0:4&is_licensemodel=permanent
Enter fullscreen mode Exit fullscreen mode

In your app:

public void ConfigureFeatures()
{
    var lv = new LicenseValidator("settings.xml");

    // Check which features are enabled
    bool hasBasic = lv.QlmLicenseObject.IsFeatureEnabledEx(0, 1);
    bool hasPro = lv.QlmLicenseObject.IsFeatureEnabledEx(0, 2);
    bool hasEnterprise = lv.QlmLicenseObject.IsFeatureEnabledEx(0, 4);

    // Enable/disable UI accordingly
    if (hasEnterprise)
    {
        EnableAllFeatures();
    }
    else if (hasPro)
    {
        EnableProFeatures();
        DisableEnterpriseFeatures();
    }
    else if (hasBasic)
    {
        EnableBasicFeatures();
        DisableProFeatures();
        DisableEnterpriseFeatures();
    }
}
Enter fullscreen mode Exit fullscreen mode

Refund Handling

Automatic License Revocation

When refund issued:

The e-commerce platform automatically:

  1. Sends refund webhook to QLM
  2. QLM receives notification
  3. QLM finds license by order ID
  4. QLM marks license as "Revoked"
  5. QLM updates database

Next time customer's app validates:

public bool ValidateLicense()
{
    var lv = new LicenseValidator("settings.xml");

    string response;
    bool isValid = lv.QlmLicenseObject.ValidateLicenseOnServer(
        lv.QlmLicenseObject.DefaultWebServiceUrl,
        lv.ActivationKey,
        lv.ComputerKey,
        out response
    );

    if (!isValid)
    {
        // License revoked (refund issued)
        ShowRevokedDialog();
        DeleteLocalKeys();
        Environment.Exit(0);
    }

    return isValid;
}

private void ShowRevokedDialog()
{
    MessageBox.Show(
        "This license has been revoked.\n\n" +
        "Reason: Refund processed\n\n" +
        "If you believe this is an error, contact support.",
        "License Revoked"
    );
}
Enter fullscreen mode Exit fullscreen mode

Prevents refund abuse: Customer can't keep using software after refund.


Security Best Practices

Webhook Security

Always validate webhooks:

// QLM does this automatically, but here's what it does:

public bool ValidateWebhook(string payload, string signature, string secret)
{
    // FastSpring uses HMAC SHA256
    using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret)))
    {
        byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(payload));
        string computedSignature = Convert.ToBase64String(hash);

        return computedSignature == signature;
    }
}

// If signature doesn't match → reject webhook
// Prevents attackers from sending fake orders
Enter fullscreen mode Exit fullscreen mode

QLM Security Features:

✅ HMAC signature validation (FastSpring, Stripe)

✅ IP whitelist (only accept from e-commerce platform)

✅ Rate limiting (prevent abuse)

✅ Encrypted communication (HTTPS only)

✅ Fraud detection (multiple activations from different IPs)


Testing Your Integration

Test Checklist

Before going live:

public class IntegrationTests
{
    [Test]
    public void TestPurchaseFlow()
    {
        // 1. Place test order
        var orderId = PlaceTestOrder("test@example.com", "Product 1");

        // 2. Wait for webhook (usually < 1 second)
        Thread.Sleep(2000);

        // 3. Verify license created in QLM
        var license = GetLicenseByOrderId(orderId);
        Assert.IsNotNull(license);
        Assert.AreEqual("test@example.com", license.Email);

        // 4. Verify license works in app
        var isValid = ValidateLicense(license.ActivationKey);
        Assert.IsTrue(isValid);

        // 5. Verify email sent
        var emailSent = CheckIfEmailSent("test@example.com", orderId);
        Assert.IsTrue(emailSent);
    }

    [Test]
    public void TestSubscriptionRenewal()
    {
        // 1. Create subscription
        var subId = CreateTestSubscription("test@example.com");

        // 2. Trigger renewal webhook
        TriggerRenewalWebhook(subId);

        // 3. Verify license extended
        var license = GetLicenseBySubscriptionId(subId);
        Assert.IsTrue(license.ExpiryDate > DateTime.Now.AddDays(25));
    }

    [Test]
    public void TestRefund()
    {
        // 1. Create license
        var orderId = PlaceTestOrder("test@example.com", "Product 1");
        var license = GetLicenseByOrderId(orderId);

        // 2. Issue refund
        IssueTestRefund(orderId);

        // 3. Trigger refund webhook
        TriggerRefundWebhook(orderId);

        // 4. Verify license revoked
        var isRevoked = CheckIfLicenseRevoked(license.ActivationKey);
        Assert.IsTrue(isRevoked);
    }
}
Enter fullscreen mode Exit fullscreen mode

Common Issues & Solutions

Issue 1: Webhook Not Firing

Symptoms: Orders placed, but no licenses created

Causes:

  • ❌ Wrong URL in e-commerce platform
  • ❌ Firewall blocking requests
  • ❌ SSL certificate issues
  • ❌ QLM service not running

Solutions:

# 1. Test webhook URL manually
curl -X POST https://yourserver.com/qlmservice.asmx/QlmWebHookHandler \
  -H "Content-Type: application/json" \
  -d '{"test": "data"}'

# Should return 200 OK

# 2. Check QLM Server Event Log
# Management Console → Server Event Log
# Look for webhook errors

# 3. Enable webhook logging
# Server Properties → webhookLogEnabled = true
# Logs saved to: C:\QLM\Logs\webhooks.log
Enter fullscreen mode Exit fullscreen mode

Issue 2: Duplicate Licenses Created

Symptoms: One order = multiple licenses

Cause: E-commerce platform retries webhook if no response

Solution:

QLM handles this automatically using order ID
If order ID already exists → skip license creation
No duplicates created
Enter fullscreen mode Exit fullscreen mode

Issue 3: Wrong Product License

Symptoms: Customer buys Pro, gets Basic license

Cause: Wrong product mapping

Solution:

In e-commerce platform fulfillment:
Double-check product ID in URL:

Basic: ?is_productid=1&is_features=0:1
Pro:   ?is_productid=1&is_features=0:2  ← CHECK THIS
Enterprise: ?is_productid=1&is_features=0:4
Enter fullscreen mode Exit fullscreen mode

Migration from Manual to Automated

Step-by-Step Migration

Current state: You manually generate/email licenses

Goal: Fully automated

Migration plan:

Week 1: Setup

  1. Configure QLM 3rd party integration
  2. Set up e-commerce webhooks
  3. Test with sandbox/test mode

Week 2: Parallel Running

  1. Enable automation
  2. Keep generating manually (backup)
  3. Monitor for issues
  4. Compare manual vs automated

Week 3: Full Automation

  1. Disable manual process
  2. Monitor closely
  3. Respond to any issues quickly

Week 4: Optimization

  1. Review analytics
  2. Optimize email templates
  3. A/B test checkout flow

Real-World Results

Case Study: SaaS Company

Before automation:

  • Manual license generation
  • 8-hour average delivery time
  • 65% activation rate
  • 20+ support tickets/week ("Where's my license?")
  • 1 person full-time managing licenses

After automation:

  • Instant license generation
  • < 60 second delivery time
  • 96% activation rate
  • 2 support tickets/week
  • 0 person-hours managing licenses

Results:

  • 31% increase in activation rate
  • $50,000/year saved on labor
  • 90% reduction in support tickets
  • 100% uptime (24/7 operation)

Using Quick License Manager

Quick License Manager provides complete e-commerce automation:

12 platform integrations (FastSpring, Stripe, etc.)

Webhook handlers (built-in, zero code)

Instant license generation (< 1 second)

Automatic email delivery (via e-commerce platform)

Subscription management (renewals, cancellations)

Refund handling (automatic revocation)

Fraud detection (prevent abuse)

Pricing:

  • QLM Professional: $699/year per developer/administrator (Windows)
  • QLM Enterprise: $999/year per developer/administrator (cross-platform)
  • QLM License Server Hosting: $599/year (optional, recommended)

All e-commerce features included in all editions.

Implementation time: < 1 day

Download QLM - 30-day trial


Best Practices Summary

DO:
✅ Use webhooks (not polling)

✅ Validate webhook signatures

✅ Test thoroughly before going live

✅ Monitor webhook logs

✅ Set up alerts for failures

✅ Use e-commerce platform's email (they handle deliverability)

✅ Implement grace periods

DON'T:
❌ Skip webhook validation (security risk)

❌ Hard-code product mappings (use database)

❌ Ignore failed webhooks

❌ Send licenses from your personal email

❌ Forget to test refund scenarios

❌ Deploy without testing sandbox first


Conclusion

Manual license distribution is:

  • ❌ Slow (hours/days delay)
  • ❌ Error-prone (human mistakes)
  • ❌ Expensive (labor costs)
  • ❌ Unscalable (limited capacity)

Automated license distribution is:

  • ✅ Instant (< 60 seconds)
  • ✅ Accurate (zero errors)
  • ✅ Free (no labor)
  • ✅ Unlimited (handle 1,000+ orders/day)

With Quick License Manager, you can implement full automation in < 1 day:

  • Zero code required for basic setup
  • Webhooks handle everything automatically
  • 12 e-commerce platforms supported
  • Proven by thousands of companies
  • 30-day free trial

Stop waking up to generate licenses. Automate it today.


Resources


Using automated license distribution? Share your e-commerce setup in the comments! 👇

Top comments (1)

Collapse
 
marcin_scholke_szolke profile image
Marcin Scholke Szolke

Do I get support if I want to embed it? And is it safe? (stupid question : ))