# Check Bills for Khanepani

This endpoint lets you retrieve bills for operators Khanepani&#x20;

## Check Bill Details API

<mark style="color:green;">`POST`</mark> `/np/recharge/check`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| Accept       | `application/json` |
| x-auth-token | `<token>`          |

**Body**

| Name               | Type   | Description                                                                                            |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------ |
| `operator_id`      | int    | ID of the relevant operator Eg. 46                                                                     |
| `operator_type_id` | int    | Operator Type ID Eg. 7                                                                                 |
| `connection_no`    | string | Customer ID Number of Bill                                                                             |
| `reference_no`     | string | Unique reference no for the request                                                                    |
| `month_id`         | string | Nepali Month 1,2,3,4,5,6, 7,8,9,10,11,12                                                               |
| `office_code`      | string | Office code location ( [refer this](https://docs.globaltopup.in/other-nepal-apis/office-code-lookup) ) |

**Response**

{% tabs %}
{% tab title="200" %}

````json
{
    "error": false,
    "message": "The action has been successfully performed.",
    "data": {
        "customer_name": "Janak Lal Maharjan",
        "connection_no": "1235",
        "reference_no": "1234785",
        "bill_amount": "533.44",
        "payments": [
            {
                "address": "Badegaun",
                "mobile_number": "NA",
                "current_month_dues": "0",
                "current_month_discount": "0",
                "current_month_fine": "0",
                "total_credit_sales_amount": "NA",
                "total_advance_amount": 0.06,
                "previous_dues": 533.44,
                "total_dues": 533.44
            }
        ]
    }
}
```
````

{% endtab %}

{% tab title="4XX/5XX" %}

```json
{
    "error": true,
    "message": "Description for the error",
}
```

{% endtab %}

{% tab title="Guzzle" %}

```php
use GuzzleHttp\Client;

$url    = 'np/recharge/check';

$form_params =
  [
    'operator_type_id' => '7',
    'operator_id'      => '46',
    'connection_no'    => '252-8846',
    'month_id'         => '11', //month number
    'office_code'      => 'BRJ:birgunj-khanepani-nwsc', 
    'reference_no'     => mt_rand(1000000,9999999)
    
  ];
            
$client = new Client([
    'base_uri' => 'https://uatservices.globaltopup.in/api/v1/',
          ]);
          $res = $client->post($url, [
          'json' => $form_params,  // Send JSON payload
          'headers' => 
        [
             'x-auth-token' => 'Token Provided by Global Topup',
             'Content-Type' => 'application/json',
             'Accept' => 'application/json'
        ]
                ]);
              
   $response       =   json_decode($res->getBody()->getContents(), true);

```

{% endtab %}

{% tab title="PHP" %}

```php
$curl = curl_init();

$data = json_encode(array(
    'operator_type_id' => '7',
    'operator_id'      => '46',
    'connection_no'    => '252-8846',
    'month_id'         => '11', //month number
    'office_code'      => 'BRJ:birgunj-khanepani-nwsc', 
    'reference_no'     => mt_rand(1000000,9999999)
));

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://uatservices.globaltopup.in/api/v1/np/recharge/check',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data, // Send JSON payload
  CURLOPT_HTTPHEADER => array(
    'x-auth-token: Token Provided by Global Topup',
    'Accept: application/json',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="Curl" %}

```php

curl -X POST https://uatservices.globaltopup.in/api/v1/np/recharge/check
     -H 'Content-Type: application/json'
     -H 'Accept: application/json' 
     -H 'x-auth-token: Global Topup Provided Token'
     -d '{"operator_id" : "46","operator_type_id" : "7",
     "connection_no" : "252-8846","month_id" : "11"
     "reference_no" : "345678",
     "office_code" : "BRJ:birgunj-khanepani-nwsc"}' // Send JSON payload
```

{% endtab %}
{% endtabs %}


---

# 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.globaltopup.in/nepal-recharge/khanepani/check-bills-for-khanepani.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.
