Skip to main content

Create a license

POST /api/reseller/licenses

Issues a new license key for one of your scripts. This is the call you wire to your "payment confirmed" webhook.

Parameters

FieldTypeRequiredDefaultNotes
scriptIdstringyesThe script to unlock. Must belong to you.
maxSlotsnumberno1Concurrent servers allowed.
notestringno""Internal note. Put your order ID here.
discordIdstringnonullYour customer's Discord ID.
expiresAtISO 8601 stringnonullnull = never expires.
prefixstringno"LIC"Prefix for the generated key, e.g. NXG-….

The key itself is always generated server-side — you cannot supply one.

Request

curl -X POST https://api.nexalab.fr/api/reseller/licenses \
-H "X-Reseller-Key: $RESELLER_KEY" \
-H "Content-Type: application/json" \
-d '{
"scriptId": "nx-garage",
"maxSlots": 2,
"note": "Order #1042",
"discordId": "987654321098765432",
"expiresAt": "2027-01-01T00:00:00.000Z",
"prefix": "NXG"
}'

Response 200 OK

{
"ok": true,
"license": {
"key": "NXG-8F3A-B1C0-D4E5",
"scriptId": "nx-garage",
"maxSlots": 2,
"note": "Order #1042",
"discordId": "987654321098765432",
"expiresAt": "2027-01-01T00:00:00.000Z",
"revoked": false,
"createdAt": "2026-07-28T12:00:00.000Z"
}
}

Deliver license.key to your customer.

Always fill in note

Store your order or invoice ID in note at creation time. When a chargeback arrives weeks later, matching the payment back to a license key is the difference between a five-second suspension and a manual hunt.

This call takes a moment

Creating a license also prepares the customer's download. Expect it to be slower than the other endpoints — allow a generous timeout (30s) and don't fire it inside a tight request/response cycle if you can queue it instead.

Examples

Lifetime, single server — the common case:

{ "scriptId": "nx-garage", "note": "Order #1042" }

Monthly subscription:

{
"scriptId": "nx-garage",
"note": "Sub #88 — renews monthly",
"discordId": "987654321098765432",
"expiresAt": "2026-08-28T00:00:00.000Z"
}

Branded key with a two-server package:

{ "scriptId": "nx-garage", "prefix": "NXG", "maxSlots": 2, "note": "Order #1103" }

Errors

StatuserrorCause
400missing_fieldsscriptId was not provided.
403forbiddenMissing, invalid or disabled reseller key.
404script_not_foundUnknown script, or it does not belong to you.

Idempotency

There is no idempotency key. A retried request creates a second license. Guard against double-issuing by recording the returned key against your order ID before acknowledging the payment webhook, and skipping the call if that order already has a key.