# Recharge Mobile & DTH

You can get the list of the available operators from the [`Operator Type Lookup API`](/india-recharge/operator-type-lookup.md) and available operator types from the [`Operator Lookup API`](/india-recharge/operator-lookup.md)

#### How To Use:

1. **Determine Operator Type**:
   * Use the [Operator Type Lookup API](/india-recharge/operator-type-lookup.md) to confirm the type (e.g., Prepaid, Postpaid, DTH , etc).
2. **Identify the Operator**:
   * First, use the [Operator Lookup API](/india-recharge/operator-lookup.md) to get the correct operator based on user input or selection.
3. Use [Operator Plan fetch API ](/india-recharge/operator-plan-fetch-api.md)to fetch Operator Plan.&#x20;
4. **Initiate Recharge**:
   * Once you have obtained all the required details (operator, type, Plan), you can use the API to initiate a recharge request with the request parameters given below.

## Execute the recharge for Ncell&#x20;

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

**Headers**

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

**Body**

<table><thead><tr><th>Name</th><th width="127">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>operator_id</code></td><td>number</td><td>The ID of the operator for the recharge.</td></tr><tr><td><code>circle_id</code></td><td>number</td><td>Enter Circle ie state Id </td></tr><tr><td><code>connection_no</code></td><td>string</td><td>The 10-digit connection number for which the recharge is to be executed.</td></tr><tr><td><code>operator_type_id</code></td><td>number</td><td>The type ID of the operator.</td></tr><tr><td><code>reference_no</code></td><td>number</td><td>The unique reference number for the recharge.</td></tr><tr><td><code>amount</code></td><td>number</td><td>Amount for which recharge has to be done Between 50 to 5,000</td></tr></tbody></table>

**Response**

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

```json
{
  "error": false,
  "message": "Additional message about the recharge"
 "data" : [
  "transaction_id" => "Transaction ID of the recharge e.g 12345",
  "reference_no"   => "Unique reference number provided by you for later reference",
  "amount"         => "Amount for which recharge has been done",
  "credit_consumed": 
       {
          "service_charge": " Processing fees charged by Company e.g 0.5 ",
          "instant_discount": " Any Discount Offered by Company e.g 0.2 ",
          "debit_amount": " Recharged amount + Service charge - instant discount e.g 10.3 "
        },
   "credit_available": "Available wallet balance after transaction e.g 8313.58",
   "commission": "If any commission provided by company e.g 3.58",
   "status"         => "Status of the recharge e.g queued, success,failed, etc"
 ]
}
```

{% endtab %}

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

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "The status of the recharge execution."
    },
    "message": {
      "type": "string",
      "description": "A message providing additional information about the recharge execution."
    },
     "data": {
      "type": "error",
      "description": "Blank array in case of error"
    }
  }
}
```

{% endtab %}

{% tab title="Guzzle" %}

<pre class="language-php"><code class="lang-php">use GuzzleHttp\Client;

$url    = 'np/recharge/execute';

$form_params =
  [
    'operator_type_id' => '1',
    'operator_id'      => '1',
    'connection_no'    => '9811802255',
    'reference_no'     => mt_rand(1000000,9999999),
    'amount'           => 'Any amount from 50 to 5000',
    'package_id'       => null
  ];
            
<strong>$client = new Client([
</strong>    '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'
        ]
                ]);
              
   $response       =   json_decode($res->getBody()->getContents(), true);

</code></pre>

{% endtab %}

{% tab title="PHP Curl " %}

```php
$curl = curl_init();

$data = json_encode(array(
    'operator_id' => '1',
    'operator_type_id' => '1',
    'connection_no' => '9811802255',
    'reference_no' => '345678',
    'amount' => '50'
));

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://uatservices.globaltopup.in/api/v1/np/recharge/execute',
  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/execute
     -H 'Content-Type: application/json'
     -H 'Accept: application/json' 
     -H 'x-auth-token: Global Topup Provided Token'
     -d '{"operator_id" : "1","operator_type_id" : "1",
     "connection_no" : "9811802255",
     "reference_no" : "345678","amount" : "50"}' // 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/india-recharge/recharge-mobile-and-dth.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.
