# Integration

## 1. Introduction

The License Verification API enables checking the status of licenses based on parameters such as **license\_id**, **product**, and **IP address**. Through a secure connection to the database, the API validates the licenses and ensures that the IP used is authorized, notifying any discrepancies in the associated Discord channel.

POST /verify

This endpoint accepts a POST request with the following parameters to verify a license:

* **license\_id**: Unique ID of the license.
* **product**: Name of the product associated with the license.
* **ip**: IP address making the request.

Example request:

```bash
curl -X POST http://your_ip:8080/verify -H "Content-Type: application/json" -d "{\"license_id\":\"123456\",\"product\":\"Product A\",\"ip\":\"192.168.1.1\"}"
```

## 2. Response

**200 OK**: The license is valid, and the IP is authorized.

```json
{
  "status": true,
  "message": "License valid.",
  "license_id": "123456",
  "expiration": "2024-12-31",
  "ip": "192.168.1.1",
  "product": "Product A"
}
```

**403 Forbidden**: The license has expired or the IP is not authorized.

```json
{
  "status": false,
  "message": "License expired."
}
```

Or

```json
{
  "status": false,
  "message": "Unauthorized IP."
}
```

**404 Not Found**: The license was not found.

```json
{
  "status": false,
  "message": "License not found."
}
```

**500 Internal Server Error**: Internal error during the license verification process.

```json
{
  "status": false,
  "message": "Internal server error."
}
```

## 3. Logging Results to Discord

Each license verification generates a log that is sent to a dedicated Discord channel. Depending on the result of the verification, logs can include details such as:

* **License not found**: Log sent with information about the license ID and IP used.
* **Expired license**: Log specifying the expiration date and associated user.
* **Unauthorized IP**: Log comparing the expected and provided IP addresses.
* **Successful license validation**: Success log with details about the license, product, and IP.
