# WLP API documentation

**Introduction**

The latest Swagger documentation is available at [this URL](https://wlp-dev2.dev.coreledger.net/api/swagger).

### Versioning

The API uses an `api-version` query parameter to specify the version of the request. If no version is specified, the API defaults to the latest available version, which is currently **1.3**.

#### Example:

* Explicit versioning:

  ```http
  GET /odata/Orders?api-version=1.3
  ```
* Using the default version:

  ```http
  GET /odata/Orders
  ```

  Since no `api-version` parameter is provided, the API will assume version **1.3** by default.

### Paging

The majority of endpoints have a limit of 100 rows per response. Except for the following endpoints:

* `odata/Currencies`
* `odata/Languages`
* `odata/Countries`

### Endpoints

**General Structure**

Each endpoint follows OData conventions, enabling filtering, sorting, and expanding related entities.

#### Example Endpoints

**List Orders**

```http
GET /odata/Orders?api-version=1.3
```

**Fetch a Single Order**

```http
GET /odata/Orders(1)?api-version=1.3
```

### Best Practices

**Efficient Data Retrieval**

To optimize performance:

* Use `$select` to specify only the required properties.
* Apply `$filter` to reduce the dataset size.
* Use `$top` and `$skip` for paging, adhering to the 100-row limit.
* Avoid `$expand` unless necessary, as it can impact performance.

**Example:**

```http
GET /odata/Orders?$select=Id,Name&$filter=CreatedOn gt '2024-01-01'&api-version=1.3
```

#### Paging Implementation

**Example:**

```http
GET /odata/Orders?$top=100&$skip=200&api-version=1.3
```


---

# 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://teos-docs.coreledger.net/white-label-portal/wlp-api-documentation.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.
