To generate a given amount of Licenses via specific Generator you can use this endpoint.
Note: The status column accepts the following values:
Number | Meaning |
1 | Sold |
2 | Delivered |
3 | Active |
4 | Inactive |
5 | Disabled |
Endpoint
POST
/wp-json/wlm/v1/generators/{generator_id}/generate
Parameters
Name | Type | Default | Is required |
---|---|---|---|
amount | number |
Yes | |
status | number |
4 | No |
save | number |
0 | No |
product_id | number |
No | |
order_id | number |
No | |
user_id | number |
No |
Responses
Examples
Example
use IdeoLogix\DigitalLicenseManagerClient\Service;
$api = new Service( 'http://site.com', 'ck_XXXX', 'cs_XXXX' );
$response = $api->generators()->generate( 1, [
'save' => 1,
'amount' => 5,
'status' => 4,
//'product_id' => '',
//'order_id' => '',
//'user_id' => '',
] );
print_r( $response->get_data() );
Response
Array
(
[0] => DZWW-BWC1-DD0W-ZZCA
[1] => W902-A112-C0A9-CCZC
[2] => 5B2A-DAB5-B91B-CA35
[3] => 0BWA-9C2C-3393-1A92
[4] => CD22-A9C1-D3AD-CB3C
)
For more details please click here.