1. Home
  2. Docs
  3. REST API
  4. Developer documentation
  5. Create a license

Create a license

Creates a new license key with the given parameters from the request body. It is possible to leave out certain keys, or explicitly set them to “null”. The response will contain the newly created license key data object.

REQUEST URL

POST

/wp-json/lmfwc/v2/licenses

 

Content-Type: application/json

**Note* You can also use “valid_for”: “45” number of days instead of

Expires_at, please do not use both at a time

REQUEST BODY:

{

“product_id”: “25”,

“license_key”: “TEST-LICENSE”,

“expires_at”: “2022-11-01”,

“status”: “active”,

“times_activated_max”: 3,

“user_id”: “1”

}

RESPONSE EXAMPLE:

 

{

“success”: true,

“data”: {

“id”: 69,

“orderId”: null,

“productId”: 25,

“userId”: 1,

“licenseKey”: “TEST-LICENSE”,

“expiresAt”: “2022-11-01 00:00:00”,

“validFor”: null,

“source”: 3,

“status”: 3,

“timesActivated”: null,

“timesActivatedMax”: 3,

“createdAt”: “2022-08-01 13:34:42”,

“createdBy”: 1,

“updatedAt”: null,

“updatedBy”: null

}

}

How can we help?