Error on License key activation
-
First of all, thanks for this wonderful. I used this to manage license key for my Woocommerce downloadable products. Plugin side is working fine though.
In the product end(which is a plugin itself) I need to validate the license key and activate it. I used the following lines of code for the same.
//To Validate
$cmd='curl --location --request GET "https://mysite.com/wp-json/lmfwc/v1/licenses/validate/2?consumer_key=ck_5f3e6a4418ea9e02fbd121182676f7720&consumer_secret=cs_2db507222ecfdc7e68b3de594a99dff86c7c" \ --header "Content-Type: application/json" \ --data "{ \"order_id\": null, \"product_id\": null, \"license_key\": \"EDITED_API_KEY_AGAIN\", \"valid_for\": null, \"status\": \"active\" }"'; exec($cmd,$result);
//To Activate
$cmd1='curl --location --request PUT "https://mysite.com/wp-json/lmfwc/v1/licenses/activate/2?order_id=48&product_id=42&updated_by=2&consumer_key=ck_5f3e6a49e02bcad6d2fbd121182676f7720&consumer_secret=cs_2db5060ab7222ecfdc7e68b94a99dff86c7c" \ --header "Content-Type: application/json" \ --data "{ \"order_id\": null, \"product_id\": null, \"license_key\": \"EDITED_API_KEY_AGAIN\", \"valid_for\": null, \"status\": \"active\" }"'; exec($cmd1,$result1);
Validation code is working fine. But the Activation part throws error. Could you please let me know the parameters should I pass with this query?
Why I am getting this error?
Array ( [0] => {“code”:”lmfwc_rest_data_error”,”message”:”Updated by User ID is invalid”,”data”:{“status”:404}} )
Waiting for your reply
- The topic ‘Error on License key activation’ is closed to new replies.