# Get Collection List

This API is to get a list of collections.

For server-side pagination, please use the query options to navigate.

## Authentication

LeanX uses **Auth Token** to authenticate in each request's header.

{% hint style="info" %}
**Auth Token** can be retrieved in your portal dashboard under **API** page.
{% endhint %}

**Request Header**

{% code overflow="wrap" %}

```json
{
    "auth-token": "LP-0D7C06DE-MM|7394e58e-edee-4c42-9ca5-bcbc449f1b9f|2141df4a3cb633d5ce8683bb0c55067e5caebfbe07390dde277dc455bcc95c91723a81b5e565c7c02d68fb84e396722563016bf99e576a4b8cdbe4423fbf226b"
}
```

{% endcode %}

## Get Collection List

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

```
https://api.leanx.dev/api/v1/merchant/collection-list
```

**Request Query**

```
?skip=0&limit=10
```

**Query**

| Query                                   | Type   | Description            |
| --------------------------------------- | ------ | ---------------------- |
| skip<mark style="color:red;">\*</mark>  | Number | Start row              |
| limit<mark style="color:red;">\*</mark> | Number | Amount of row per page |

**Request Body**

```json
{
  "start_date": "01-01-1970",
  "end_date": "31-12-2050",
  "record_status": 1,
  "search": {
    "search_enable": false,
    "search_key": "TEST COLLECTION",
    "search_column": "title"
  },
  "sort": {
    "sort_type": "desc",
    "parameter_name": "created_at"
  }
}
```

**Attributes**

<table><thead><tr><th width="251">Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>start_date<mark style="color:red;">*</mark></td><td>String</td><td>Start date in DD-MM-YYYY format</td></tr><tr><td>end_date<mark style="color:red;">*</mark></td><td>String</td><td>End date in DD-MM-YYYY format</td></tr><tr><td>record_status<mark style="color:red;">*</mark></td><td>Number</td><td>1 = ACTIVE</td></tr><tr><td>search.search_enable<mark style="color:red;">*</mark></td><td>Boolean</td><td>To enable searches</td></tr><tr><td>search.search_key</td><td>String</td><td>Search value. Required if <code>search.search_enable</code> is <code>true</code></td></tr><tr><td>search.search_column</td><td>String</td><td>A collection property. Required if <code>search.search_enable</code> is <code>true</code></td></tr><tr><td>sort.sort_type</td><td>String</td><td><code>asc</code> or <code>desc</code></td></tr><tr><td>sort.parameter_name</td><td>String</td><td>One of collection property. Eg: <code>created_at</code></td></tr></tbody></table>

**Response**

{% code overflow="wrap" %}

```json
{
  "response_code": 2000,
  "description": "SUCCESS",
  "app_version": "/api/v1",
  "talk_to_server_before": "2023-01-25T11:31:35.413432",
  "data": {
    "list": {
      "draw": 1,
      "record_total": 1,
      "record_filtered": 1,
      "data": [
        {
          "title": "Public API Collection Creation",
          "record_status": 1,
          "uuid": "CL-AUTH-ADA0B0240E-LNP",
          "created_at": "2023-01-25T11:14:40",
          "description": "This is public API collection description",
          "updated_at": "2023-01-25T10:58:04",
          "enable_billing_address": true,
          "min_amount": 160,
          "id": 15,
          "fixed_amount": true,
        }
      ],
      "next_page_start": 10,
      "next_page_length": 10,
      "previous_page_start": "",
      "previous_page_length": 10
    }
  },
  "breakdown_errors": "",
  "token": "dbd44a99-2d0f-470d-91fe-c73e8cdd1848"
}
```

{% endcode %}


---

# 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/cloud-payment/collection/manage/get-collection-list.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.
