# Service Status API

You can get status of your recharge sending Transaction number received from api during order post

## Status of Nepal Operators &#x20;

<mark style="color:green;">`POST`</mark> `{base_url}/np/service/status`

## Status of Indian Operators &#x20;

<mark style="color:green;">`POST`</mark> `{base_url}/in/service/status`

**Headers**

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

**Body**

<table><thead><tr><th>Name</th><th width="127">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>transaction_id</code></td><td>number</td><td>Transaction number received from api during order post</td></tr></tbody></table>

**Response**

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

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "error": false,
    "message": "Additional message about the recharge",
    "data": {
        "status": "Current Status of Order",
        "transaction_id": "Id provided by API during recharge",
        "order_id": "Reference number shared by Merchant",
        "amount": "Amount of Order",
        "timestamp": "December 21,2024 9:03pm",
        "details": {
            "connection_no": "Number / user id of order",
            "operator": "Service Operator Name"
        },
        "package_name": null
    }
}
</code></pre>

{% 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" %}

```php
use GuzzleHttp\Client;

$url    = 'np/service/status';

$form_params =
  [
    'transaction_id'   => '37912309579059' //transaction_id received in execute payment response
  ];
            
$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'
        ]
                ]);
              
   $response       =   json_decode($res->getBody()->getContents(), true);

```

{% endtab %}

{% tab title="PHP" %}

```php
$curl = curl_init();

$data = json_encode(array(
    'transaction_id'   => '37912309579059' //transaction_id received in execute payment response
));

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://uatservices.globaltopup.in/api/v1/np/service/status',
  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/service/status
     -H 'Content-Type: application/json'
     -H 'Accept: application/json' 
     -H 'x-auth-token: Global Topup Provided Token'
     -d '{"transaction_id" : "37912309579059"}' // 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/advance-options/service-status-api.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.
