This endpoint can be used to update License records in the database. List of parameters and example responses can be found below.
Note: The status column accepts the following values:
Number | Meaning |
1 | Sold |
2 | Delivered |
3 | Active |
4 | Inactive |
5 | Disabled |
Endpoint
PUT
/wp-json/dlm/v1/licenses/{license_key}
Parameters
Name | Type | Default | Is required |
---|---|---|---|
license_key | string |
No | |
valid_for | number |
No | |
order_id | number |
No | |
product_id | number |
No | |
user_id | number |
No | |
activations_limit | number |
No | |
status | number |
No |
Responses
{
"success": true,
"data": {
"id": 5,
"order_id": 39,
"product_id": 12,
"user_id": 1,
"license_key": "Z09Z-D0DZ-9A29-3BCD",
"expires_at": null,
"valid_for": 365,
"source": 1,
"status": 2,
"times_activated": 1,
"activations_limit": 5,
"is_expired": false,
"created_at": "2021-06-27 16:58:10",
"created_by": 1,
"updated_at": "2021-07-09 21:54:24",
"updated_by": 1
}
}
{
"code": "data_error",
"message": "The license key 'DASK-1281-JCAJ-KMAP' already exists",
"data": {
"code": 409
}
}
Examples
Example
use IdeoLogix\DigitalLicenseManagerClient\Service;
$api = new Service( 'http://site.com', 'ck_XXXX', 'cs_XXXX' );
$response = $api->licenses()->update('DASK-1281-JCAJ-8888', [
'expires_at' => '2022-04-05 12:00:00',
]);
print_r($response->get_data());
Response
Array
(
[id] => 35
[order_id] => 39
[product_id] => 12
[user_id] => 1
[license_key] => DASK-1281-JCAJ-8888
[expires_at] => 2022-04-05 12:00:00
[valid_for] => 365
[source] => 3
[status] => 1
[times_activated] => 0
[activations_limit] => 3
[is_expired] => false
[created_at] => 2021-08-28 07:00:46
[updated_at] => 2021-08-28 07:24:48
)
For more details please click here.