# Token Validation

The Lean.x API employs API keys for secure request authentication. Easily handle and oversee your API keys using the Lean.x Dashboard.

Ensuring the security of your API keys is crucial due to the substantial privileges they carry. Avoid sharing confidential API keys in public platforms like GitHub or client-side code.

For the protection of your data, it is mandatory to transmit all API requests via HTTPS. Attempts to initiate API requests using plain HTTP will not yield success. Furthermore, API requests lacking proper authentication will not undergo processing.

{% hint style="info" %}
The token in the following example is derived from the sample token provided on the  [Credential](/api-docs/credential.md) page. As recommended, kindly obtain your own test credentials from the Sandbox Dashboard.
{% endhint %}

## Validating Token

HTTP Method: <mark style="color:yellow;">POST</mark>

```
https://api.leanx.dev/api/v1/merchant/validate
```

#### Request Body

```
no request body
```

#### Response

```json
{
  "response_code": 2000,
  "description": "SUCCESS",
  "app_version": "/api/v1",
  "talk_to_server_before": "2023-01-27T08:33:32.517978",
  "data": {
    "merchant-id": "LP-5220D22D-MM",
    "merchant-name": "LeanX Demo",
    "merchant-created": "2023-01-18T06:13:12"
  },
  "breakdown_errors": "",
  "token": ""
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.leanx.io/api-docs/token-validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
