Skip to main content

License API

Full API reference for license management. All endpoints require authentication via JWT Bearer token or API Key (where noted).

Base path: /api/v1/portal/licenses

List Licenses

GET /api/v1/portal/licenses

Auth: JWT or API Key

Returns all your licenses. Resellers/Agencies also see sub-client licenses.

Query Parameters:

ParameterTypeDescription
statusstringFilter by status: active, revoked, expired
sourcestringFilter by source: individual, bulk_pack, commitment, nfr
searchstringSearch by license key or domain

Response:

[
{
"id": 42,
"license_key": "FLVR-ABCD-EFGH-IJKL-MNOP",
"product": {
"id": 1,
"name": "Flavor Starter Theme",
"slug": "flavor-starter"
},
"tier": "starter",
"status": "active",
"source": "individual",
"expires_at": "2027-03-30T00:00:00Z",
"activations": [
{
"domain": "mysite.com",
"activated_at": "2026-03-30T12:00:00Z"
}
],
"customer_id": 1,
"created_at": "2026-03-30T10:00:00Z"
}
]

Get License Usage

GET /api/v1/portal/licenses/usage

Auth: JWT

Response:

{
"total_licenses": 3,
"limit": 5,
"remaining": 2
}
  • limit is -1 for unlimited (Reseller/Agency)
  • NFR licenses are excluded from the count

Get Pack Credits

GET /api/v1/portal/licenses/pack-credits

Auth: JWT

Returns active bulk pack credit balances.

Response:

{
"total_credits": 15,
"packs": [
{
"pack_id": 1,
"pack_size": 20,
"bundle": "starter",
"used": 5,
"remaining": 15,
"status": "active"
}
]
}

Create License

POST /api/v1/portal/licenses

Auth: JWT or API Key Role: Developer, Reseller, or Agency

Request Body:

{
"product_id": 1,
"tier": "starter",
"expires_at": "2027-03-30T00:00:00Z",
"customer_id": 15
}
FieldTypeRequiredDescription
product_idintegerYesProduct to license
tierstringNostarter or business (default: starter)
expires_atdatetimeNoLicense expiry (default: 1 year)
customer_idintegerNoAssign to a sub-client (Reseller/Agency only)

Response: 201 Created

{
"id": 43,
"license_key": "FLVR-WXYZ-...",
"tier": "starter",
"status": "active",
"expires_at": "2027-03-30T00:00:00Z"
}

Bulk Create Licenses

POST /api/v1/portal/licenses/bulk

Auth: JWT or API Key Role: Reseller or Agency

Request Body:

{
"product_id": 1,
"count": 10,
"tier": "starter",
"expires_at": "2027-03-30T00:00:00Z",
"customer_id": 15
}
FieldTypeRequiredDescription
product_idintegerYesProduct to license
countintegerYesNumber of licenses (1-100)
tierstringNostarter or business
expires_atdatetimeNoLicense expiry
customer_idintegerNoAssign to a sub-client

Response: 201 Created

{
"count": 10,
"license_keys": ["FLVR-...", "FLVR-...", "..."],
"pack_credits_remaining": 5
}

Change License Tier

PATCH /api/v1/portal/licenses/{license_id}

Auth: JWT Role: Developer, Reseller, or Agency

Request Body:

{
"tier": "business"
}

Response:

{
"success": true,
"message": "License tier updated",
"old_tier": "starter",
"new_tier": "business"
}
note

Business tier requires a Business Bundle subscription.


Revoke License

DELETE /api/v1/portal/licenses/{license_id}

Auth: JWT Role: Developer, Reseller, or Agency

Revokes the license and deactivates all domains.

Response:

{
"success": true,
"message": "License revoked"
}

Permanently Delete License

DELETE /api/v1/portal/licenses/{license_id}/permanent

Auth: JWT Role: Developer, Reseller, or Agency

Only works on revoked licenses. Blocked if the license has been invoiced.

Response:

{
"success": true,
"message": "License permanently deleted"
}

Reactivate License

POST /api/v1/portal/licenses/{license_id}/reactivate

Auth: JWT or API Key Role: Developer, Reseller, or Agency

Reactivates a revoked license (free, if not expired).

Response:

{
"success": true,
"message": "License reactivated"
}

Bulk Revoke

POST /api/v1/portal/licenses/bulk-revoke

Auth: JWT Role: Developer, Reseller, or Agency

Request Body:

{
"ids": [42, 43, 44]
}

Maximum 100 licenses per request.

Response:

{
"revoked": 3
}

Bulk Delete

POST /api/v1/portal/licenses/bulk-delete

Auth: JWT Role: Developer, Reseller, or Agency

Only deletes revoked licenses. Maximum 100 per request.

Request Body:

{
"ids": [42, 43, 44]
}

Response:

{
"deleted": 3
}

Bulk Renew

POST /api/v1/portal/licenses/bulk-renew

Auth: JWT

Initiates a bulk license renewal via Viva Wallet checkout.

Request Body:

{
"license_ids": [42, 43, 44]
}

Response: Returns checkout URL and order info.


Confirm Bulk Renewal

POST /api/v1/portal/licenses/bulk-renew/confirm

Auth: JWT

Request Body:

{
"transaction_id": "abc123",
"order_code": "def456"
}

Response: Confirmation with updated license expiry dates.


Get Renewal Info

GET /api/v1/portal/licenses/renewal-info

Auth: JWT

Returns renewal pricing and information about expiring licenses.