Activate license
const url = 'https://example.com/wp-json/wp2/license/v1/example/activate';const options = { method: 'POST', headers: {'X-WP-Nonce': '<X-WP-Nonce>', 'Content-Type': 'application/json'}, body: '{"license_key":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/wp-json/wp2/license/v1/example/activate \ --header 'Content-Type: application/json' \ --header 'X-WP-Nonce: <X-WP-Nonce>' \ --data '{ "license_key": "example" }'Activates a product license with license_key via the license service. Unknown product_id is 404; hub refusal is 400.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”License product slug.
Request Body
Section titled “Request Body”object
Product license key.
Example
{ "license_key": "example"}Responses
Section titled “Responses”Activated
object
Success flag (often Studio/License envelope).
Extra WP_Error or license payload.
object
Message text (log, PIN, or password reset).
Examplegenerated
{ "success": true, "data": {}, "message": "example"}Missing_license_key / activation_failed
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Insufficient capability or invalid REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Unknown_license_product
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}