Skip to main content

Endpoint

Generates a new license key for an existing purchase while maintaining all other purchase data. This is useful when a license key has been compromised or shared publicly, and you need to issue a replacement key to the legitimate customer.
This endpoint requires authentication with the edit_products scope.
After rotation, the old license key will no longer work. Make sure to communicate the new key to your customer.

Authentication

This endpoint requires an OAuth access token with the edit_products scope. Include your access token in the request:

Request Parameters

string
required
Your OAuth access token with edit_products scope
string
required
The current license key to rotate
string
The unique identifier for your product (recommended)
The product’s permalink (either unique or custom). Can be used instead of product_id.

Response Fields

boolean
Whether the operation was successful
integer
The current usage count for this license (preserved from the old key)
object
Complete purchase information with the new license key
string
The newly generated license key (this replaces the old one)
Other fields follow the same structure as the verify endpoint

Examples

Rotate a license key

Success Response

Error Responses

Unauthorized (401)

Forbidden (403)

Returned when the access token doesn’t have the edit_products scope.

Not Found (404)

Returned when the license doesn’t exist or doesn’t belong to your product.

Common Use Cases

Respond to Compromised Keys

If a customer’s license key is shared publicly (e.g., on social media or piracy sites), you can rotate it to invalidate the old key and provide them with a new one.

Customer Support

When a customer reports unauthorized use of their license, you can rotate the key as part of your resolution process. This ensures the unauthorized user loses access while the legitimate customer gets a working key.

Security Best Practices

Some organizations require periodic key rotation as a security measure. This endpoint makes it easy to implement such policies.

Implementation Example

The new license key is automatically generated using a secure random algorithm. You cannot specify a custom key format.
Only the product owner can rotate licenses for their products. You must authenticate with an access token from the product owner’s account.

License Key Format

Generated license keys follow the format: XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX
  • 32 hexadecimal characters (0-9, A-F)
  • Divided into 4 groups of 8 characters
  • Separated by hyphens
  • Always uppercase