# Get Bill List

This API is to fetch a list of bills from across all collections.

## 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 Bill List

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

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

**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,
  "invoice_status": "success",
  "search": {
    "search_enable": true,
    "search_key": "50",
    "search_column": "id"
  },
  "sort": {
    "parameter_name": "created_at",
    "sort_type": "desc"
  }
}
```

**Attributes**

<table><thead><tr><th width="251">Property</th><th width="227">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>invoice_status</td><td>String</td><td><code>success</code>/<code>failed</code>/<code>pending</code></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-02-01T17:53:25.430186",
  "data": {
    "list": {
      "draw": 1,
      "record_total": 1,
      "record_filtered": 1,
      "data": [
        {
          "phone_number": "0182954574",
          "invoice_status_id": 2,
          "collection_id": 16,
          "created_at": "2023-01-31T14:48:53",
          "status": null,
          "bill_transaction_type_id": 1,
          "payment_record_id": 74,
          "updated_at": "2023-01-31T14:48:55",
          "id": 73,
          "total": 1.00,
          "shipping_address_id": null,
          "customer_id": 28,
          "total_amount_with_fee": 1.70,
          "invoice_status": "SUCCESS",
          "account_id": 2,
          "full_name": "Roro",
          "transaction_fee": 0.70,
          "base_url": null,
          "api_key": null,
          "quantity": 1,
          "checking_counter": 1,
          "payment_date": "2023-01-31T14:48:54",
          "email": "roro@gmail.com",
          "invoice_no": "BP-5F1F5BD9E7-LNP",
          "price_per_quantity": null,
          "record_status": 1,
          "transaction_invoice_no": "FPX16751477326yuoZYft",
          "customer_bill_payment_record": {
            "reference_number": "FPX16751477326yuoZYft",
            "payment_date": "2023-01-31T14:48:54",
            "payment_method": "STANDARD_CHARTERED_WEBPAY",
            "transaction_fee": 0.50,
            "bank_code": null,
            "net_amount": 2,
            "total": null,
            "record_status": 1,
            "updated_at": "2023-01-31T14:48:55",
            "id": 74,
            "payment_mode": "WEB_PAYMENT",
            "amount": 1,
            "kind": null,
            "paid_at": null,
            "customer_id": 28,
            "created_at": "2023-01-31T14:48:53"
          }
        }
      ],
      "next_page_start": 10,
      "next_page_length": 10,
      "previous_page_start": 0,
      "previous_page_length": 10
    }
  },
  "breakdown_errors": null,
  "token": ""
}
```

{% endcode %}
