Skip to content

API Quick Start

Add license validation to any app — Laravel, Node.js, Python, Go, or custom platforms.

PackEdge provides SDKs and REST APIs to validate licenses, track usage, and collect feedback.

Choose Your Integration

MethodPackageBest For
JS SDKpackedgeFrontend, browser apps
PHP SDKpackedge-sdk/licensePHP backends
REST APIAny language, custom needs

WordPress?

If you're building a WordPress plugin, see WordPress Quick Start for the fastest path.


1. Create Your Product

  1. Log into the PackEdge Console
  2. Go to ProductsNew Product
  3. Enter your product name and type
  4. Note your public_key — you'll need it

2. Generate a License

  1. Go to LicensesNew License
  2. Select your product
  3. Enter customer email
  4. Set seats and expiration
  5. Note the generated license key

3. Validate a License

bash
curl -X POST https://api.packedge.dev/public/v1/licenses/validate \
  -H "Content-Type: application/json" \
  -d '{
    "public_key": "pk_your_public_key",
    "license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX"
  }'

Response:

json
{
  "valid": true,
  "license": {
    "key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
    "status": "active",
    "seats": 5,
    "activatedCount": 0,
    "expiresAt": "2027-02-06T00:00:00.000Z"
  }
}

4. Activate a License

bash
curl -X POST https://api.packedge.dev/public/v1/licenses/activate \
  -H "Content-Type: application/json" \
  -d '{
    "public_key": "pk_your_public_key",
    "license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
    "domain": "https://customer-site.com"
  }'

Response:

json
{
  "success": true,
  "activation_id": "act_xxx",
  "activated_at": "2026-02-06T12:00:00.000Z"
}

5. Check Activation

bash
curl -X POST https://api.packedge.dev/public/v1/licenses/check \
  -H "Content-Type: application/json" \
  -d '{
    "public_key": "pk_your_public_key",
    "license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
    "domain": "https://customer-site.com"
  }'

Response:

json
{
  "activated": true,
  "activation_id": "act_xxx"
}

6. Deactivate

bash
curl -X POST https://api.packedge.dev/public/v1/licenses/deactivate \
  -H "Content-Type: application/json" \
  -d '{
    "public_key": "pk_your_public_key",
    "license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
    "domain": "https://customer-site.com"
  }'

Code Examples

bash
pnpm add packedge
bash
npm install packedge
bash
yarn add packedge
bash
bun add packedge
javascript
import packedge from 'packedge';

packedge.init('pk_your_public_key');

// Validate (site auto-detected)
const result = await packedge.validateLicense(licenseKey);

if (result.valid) {
  console.log('License active until', result.license.expiresAt);
}

// Activate
await packedge.activateLicense(licenseKey);

// Track usage
packedge.track('feature_used', { feature: 'export' });

Or via CDN (non-WordPress):

html
<script src="https://cdn.packedge.dev/packedge.js"></script>
bash
composer require packedge-sdk/license
composer require packedge-sdk/analytics
php
use PackEdge\License;
use PackEdge\Analytics;

// License validation
$license = License::init('pk_your_public_key', __FILE__);

if ($license->is_valid()) {
    echo 'License is active';
}

// Auto-updates
$license->updater();

// Track usage (separate package)
$analytics = Analytics::init('pk_your_public_key', __FILE__);
$analytics->track('feature_used', ['feature' => 'export']);

REST API (Any Language)

javascript
// JavaScript (fetch)
async function validateLicense(licenseKey) {
    const response = await fetch('https://api.packedge.dev/public/v1/licenses/validate', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
            public_key: 'pk_your_public_key',
            license_key: licenseKey,
        }),
    });
    return response.json();
}
python
# Python
import requests

def validate_license(license_key):
    response = requests.post(
        'https://api.packedge.dev/public/v1/licenses/validate',
        json={
            'public_key': 'pk_your_public_key',
            'license_key': license_key,
        }
    )
    return response.json()
go
// Go
func validateLicense(licenseKey string) (map[string]interface{}, error) {
    body, _ := json.Marshal(map[string]string{
        "public_key":  "pk_your_public_key",
        "license_key": licenseKey,
    })
    resp, err := http.Post(
        "https://api.packedge.dev/public/v1/licenses/validate",
        "application/json",
        bytes.NewBuffer(body),
    )
    // ...
}

Error Handling

All endpoints return error details in the response:

json
{
  "valid": false,
  "error": "License has expired"
}

Common errors:

ErrorMeaning
Invalid public_keyCheck your public key
License key not foundInvalid license key
License has expiredLicense past expiration date
License is suspendedLicense manually suspended
License seat limit reachedNo available seats

Next Steps