Product ID Validation #
Version note: Product ID validation was added to all public license endpoints in v2.0.0.
What It Is #
All public license endpoints (activate, deactivate, validate, check-in, verify) now require a product_id parameter. The system verifies that the license key belongs to the specified product. If it does not match, the request is rejected.
Why It Matters #
Without product ID validation, a license key for Product A could theoretically be used to activate Product B. This “cross-product activation” vulnerability is now closed.
Example of what was previously possible (now blocked):
A customer has a valid license for “Plugin A”. They attempt to use that license key on a request that specifies Product B’s product_id. In v2.0.0, this returns a dmsilm_product_mismatch error.
The validate_product_ownership() Helper #
Internally, product ID validation is performed by DMSILM_API_Licenses::validate_product_ownership(). This function:
- Looks up the license record by key or ID
- Checks that
license->product_idmatches theproduct_idparameter in the request - Returns a
WP_Errorwith codedmsilm_product_mismatchif they do not match
This check runs on every activate, deactivate, validate, check-in, and verify call.
What product_id to Use #
The product_id value is the DDLS internal product ID — NOT the WooCommerce product ID. Find your product IDs in DDLS > Products (the ID column or URL parameter when editing a product).
Migration Guide for Existing Integrations #
If your client software was built against the v1.x API:
- Retrieve your DDLS product ID from DDLS > Products
- Add
"product_id":to all activation, deactivation, and validation API calls - Handle the new
dmsilm_product_mismatcherror code in your error handling logic
