License Module Usage

How to use the license module in Store System

Store Template v2 comes packaged with a license system. This allows developers who can connect their projects to an API the ability to restrict usage of their products. The license module itself works very simply:

You create POST request to yourdomain.tld/licenses/api with the following parameters:

  • key
  • product

When you send this request, you will be returned a JSON response that includes an array. This array will include a 'code' and 'message'. The codes (when returned) mean the following:

  • 5000: No license key provided
  • 5001: No product name provided
  • 5002: No data was provided
  • 5003: Error in MySQL query statement
  • 5004: No results match
  • 5005: IP doesn't match provided data
  • 5006: License has been disabled
  • 5007: Allowed to use product

The message provided is for sample debugging and has no practical (or safe) application inside of any programming environment. Rely on the returned data code to give you a proper setup for usage of your system. Lastly, one of the codes provided above talks about an IP not matching. This is the 'ipChecking' setting on the license module. This means that you're required to have a matching IP to use a certain product. This IP isn't sent through the POST request (this has a possibility of someone be able to spoof their IP or change it somehow). This IP is received as part of the client details for the API request sent.