Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

Licenses

Endpoints for activating, verifying and deactivating license keys from inside an installed plugin.

POST /wp-json/pfw-portal/v1/license/activate

Activates a license against a specific site fingerprint. Returns the per-site token used for subsequent calls.

Request body (JSON):

FieldTypeRequiredDescription
license_keystringyesPFW-XXXX-XXXX-XXXX-XXXX-XXXX
product_slugstringyeswp-pfworkflow, wp-pfagent, wp-pfmanagement
site_fingerprintstringyessha256(home_url + secret_salt)
site_urlstringyesCustomer-visible site URL

Successful response (200):

{
  "status": "ok",
  "data": {
    "token": "<hmac-signed-token>",
    "expires_at": "2027-05-17T11:33:46Z",
    "site_limit": 5,
    "sites_used": 2
  }
}

Failures:

CodeerrorMeaning
404license_not_foundThe key does not exist
422license_not_activeLicense is expired, revoked, etc.
422license_slot_limit_exceededYou hit the site_limit on this license
422product_mismatchKey is valid but for a different product

POST /wp-json/pfw-portal/v1/license/verify

Used by the plugin's 24h heartbeat. Confirms the license is still good and refreshes the activation timestamp on the portal side.

Request body: only Authorization: Bearer <token> is needed; the token contains the license id internally.

Successful response (200):

{
  "status": "ok",
  "data": {
    "status": "active",
    "expires_at": "2027-05-17T11:33:46Z"
  }
}

Plugin behaviour on each response status:

  • active: normal operation continues.
  • expired: lock out premium features but keep the plugin loaded so the user can still see the banner + click through to the customer dashboard.
  • revoked: same as expired but with a different banner copy (contact support).

POST /wp-json/pfw-portal/v1/license/deactivate

Frees a slot. Called from the plugin's Settings → Deactivate button. Token is invalidated.

Successful response (200):

{ "status": "ok", "data": { "slots_freed": 1 } }