# DTH Package

This endpoint lets you retrieve package listings for operators such as&#x20;

1. **Dish Home : Operator ID 36**
2. Mero TV : Operator ID 38
3. SKY TV : Operator ID 39
4. Clear TV : Operator ID 40
5. Prabhu TV : Operator ID 41
6. Jagriti Cable: Operator ID 42
7. Max TV : Operator ID 43
8. Nijgard Cable : Operator ID 58
9. Net TV : Operator id 100

#### How To Use:

1. **Identify the Operator**:
   * First, use the [Operator Lookup API ](/additional-nepal-apis/operator-lookup.md)to get the correct operator based on user input or selection.
2. **Determine Operator Type**:
   * Use the [Operator Type Lookup API ](/additional-nepal-apis/operator-type-lookup.md)to confirm the type (e.g., Mobile, DTH, Data Pack, etc).
3. **Initiate Package**:
   * Once you have obtained all the required details (operator, type), you can use the API to initiate a package request with the request parameters given below.

## Package Listing API

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

**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         |
| `operator_type_id` | int    | Operator Type ID                    |
| `connection_no`    | string | Operator ID/ CAS ID of DTH          |
| `reference_no`     | string | Unique reference no for the request |

**Respons**

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

```json
{
    "error": false,
    "message": "The action has been successfully performed.",
    "data": {
        "operator_id": "43",
        "connection_no": "DTH Number 0000405146",
        "reference_no": "Unique Reference Number 1234206",
        "customerinfo": " Name: THULI KANXI NEPALI NA NA || STB No: 6030637001423169",
        "session_id": 2078,
        "packages": [
            {
                "id": 1,
                "name": "Amount 350",
                "amount": 350
            }
        ]
    }
}
```

{% endtab %}

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

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

{% endtab %}

{% tab title="Guzzle" %}

```php
use GuzzleHttp\Client;

$url    = 'np/recharge/package';

$form_params =
  [
    'operator_type_id' => '2',
    'operator_id'      => '43',
    'connection_no'    => 'DTH Number eg. 0000405146',
    '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
<?php

$curl = curl_init();

$data = json_encode(array(
    'operator_id' => '43',
    'operator_type_id' => '2',
    'connection_no' => 'DTH Number eg. 0000405146',
    'reference_no' => '345678'
));

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://uatservices.globaltopup.in/api/v1/np/recharge/package',
  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(
    'Content-Type: application/json',
    'Accept: application/json',
    'x-auth-token: Token Provided by Global Topup'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="Curl" %}

<pre class="language-php"><code class="lang-php"><strong>
</strong><strong>curl -X POST https://uatservices.globaltopup.in/api/v1/np/recharge/package
</strong>     -H 'Content-Type: application/json'
     -H 'Accept: application/json' 
     -H 'x-auth-token: Global Topup Provided Token'
     -d '{"operator_id" : "43","operator_type_id" : "2",
     "connection_no" : "DTH Number eg. 0000405146",
     "reference_no" : "345678"}' // Send JSON payload
</code></pre>

{% endtab %}
{% endtabs %}

The response contains an error flag and a message, along with an array of objects with package listing data in case of a successful response, where each package object will have `id`, `name` and `amount`


---

# 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/dth/dth-package.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.
