Create a license

Estimated reading: 1 minute 182 views

Description

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

REQUEST HEADERS

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

}

}
Share this Doc

Create a license

Or copy link

CONTENTS
Scroll to Top