> For the complete documentation index, see [llms.txt](https://raphaelugwu.gitbook.io/airtime/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raphaelugwu.gitbook.io/airtime/transactions/get-transaction-by-id.md).

# Get transaction by ID

With the `topups/reports/transactions/{transactionid}` endpoint, you can retrieve information on a top-up transaction by making a request with the transaction's ID

## Transaction by ID

<mark style="color:blue;">`GET`</mark> `https://topups.reloadly.com/topups/reports/transactions/{transactionid}`

#### Path Parameters

| Name                                            | Type    | Description                               |
| ----------------------------------------------- | ------- | ----------------------------------------- |
| transactionId<mark style="color:red;">\*</mark> | integer | The ID of the transaction to be retrieved |

#### Headers

| Name                                            | Type   | Description                                                             |
| ----------------------------------------------- | ------ | ----------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Your access token is required as a bearer token in the request's header |

{% tabs %}
{% tab title="200 This response is gotten when a successful request is made and the details of a transaction are retrieved" %}
{% tabs %}
{% tab title="JSON" %}

```bash
{
  "transactionId": 27623,
  "status": "SUCCESSFUL",
  "operatorTransactionId": null,
  "customIdentifier": null,
  "recipientPhone": "2348147658720",
  "recipientEmail": null,
  "senderPhone": "2341231231231",
  "countryCode": "NG",
  "operatorId": 341,
  "operatorName": "MTN Nigeria",
  "discount": 0,
  "discountCurrencyCode": "NGN",
  "requestedAmount": 100,
  "requestedAmountCurrencyCode": "NGN",
  "deliveredAmount": 100,
  "deliveredAmountCurrencyCode": "NGN",
  "transactionDate": "2022-02-21 04:19:26",
  "pinDetail": null,
  "balanceInfo": {
    "oldBalance": 969849.49,
    "newBalance": 969749.49,
    "cost": 100,
    "currencyCode": "NGN",
    "currencyName": "Nigerian Naira",
    "updatedAt": "2022-02-21 09:19:26"
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="401 This response is gotten when a request is made with an incorrect or expired access token" %}
{% tabs %}
{% tab title="JSON" %}

```bash
{
  "timeStamp":"2021-06-09 20:59:35",
  "message":"Full authentication is required to access this resource",
  "path":"/topups/reports/transactions/270395",
  "errorCode":"INVALID_TOKEN",
  "infoLink":null,
  "details":[
    
  ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="404 This response is gotten when a request is made with a transaction ID that doesn't exist" %}
{% tabs %}
{% tab title="JSON" %}

```bash
{
  "timeStamp":"2021-06-09 20:51:40",
  "message":"Airtime transaction not found",
  "path":"/topups/reports/transactions/270395111",
  "errorCode":null,
  "infoLink":null,
  "details":[
    
  ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

###

### Request samples

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

```bash
curl --location --request GET 'https://topups.reloadly.com/topups/reports/transactions/1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
--header 'Accept: application/com.reloadly.topups-v1+json' 
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;

namespace WebAPIClient {
  class Program {

    static async Task Main(string[] args) {
      await ApiCall();
    }

    private static async Task ApiCall() {

      var message = new HttpRequestMessage(HttpMethod.Post, "https://topups.reloadly.com/topups/reports/transactions/1");

      message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
      message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");

      using
      var httpClient = new HttpClient();
      var response = await httpClient.SendAsync(message);
      var responseBody = await response.Content.ReadAsStringAsync();
      var result = JsonConvert.DeserializeObject < dynamic > (responseBody);

      Console.WriteLine(result);
    }

  }
}
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://topups.reloadly.com/topups/reports/transactions/1"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
  req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://topups.reloadly.com/topups/reports/transactions/1")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
  .addHeader("Accept", "application/com.reloadly.topups-v1+json")
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Node JS" %}

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://topups.reloadly.com/topups/reports/transactions/1',
  'headers': {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
    'Accept': 'application/com.reloadly.topups-v1+json'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://topups.reloadly.com/topups/reports/transactions/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
    'Accept: application/com.reloadly.topups-v1+json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://topups.reloadly.com/topups/reports/transactions/1"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
  'Accept': 'application/com.reloadly.topups-v1+json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

###

### Response parameters

| Parameter                                                           | Type    | Description                                                                                                                            |
| ------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `transactionId`                                                     | integer | Indicates the unique ID of a top-up                                                                                                    |
| `status`                                                            | string  | Indicates the status of a transaction.                                                                                                 |
| <p><code>operator</code></p><p><code>TransactionId</code></p>       | string  | Indicates the transaction ID assigned by the operator of the receiving mobile number                                                   |
| `customIdentifier`                                                  | string  | This is the top-up's reference that is to be assigned by the sender                                                                    |
| `senderPhone`                                                       | string  | This indicates the sender's mobile number                                                                                              |
| `countryCode`                                                       | string  | Indicates the ISO code of the country where the operator is registered                                                                 |
| `operatorId`                                                        | integer | The ID of the receiving mobile number's operator                                                                                       |
| `operatorName`                                                      | string  | The name of the receiving mobile number's operator                                                                                     |
| `requestedAmount`                                                   | integer | Indicates the top-up amount sent by the originating account                                                                            |
| `discount`                                                          | integer | Indicates if there was a discount on the top-up made and at what rate                                                                  |
| <p><code>discountCurrency</code></p><p><code>Code</code></p>        | string  | Indicates the currency code of the receiving mobile number                                                                             |
| <p><code>requestedAmount</code></p><p><code>CurrencyCode</code></p> | string  | Indicates the currency code of the originating account                                                                                 |
| `deliveredAmount`                                                   | integer | Indicates the top-up amount received by the receiving mobile number                                                                    |
| <p><code>deliveredAmount</code></p><p><code>CurrencyCode</code></p> | string  | Indicates the currency in which the top-up was delivered                                                                               |
| `transactionDate`                                                   | string  | Indicates the date and time the top-up was made                                                                                        |
| pinDetail                                                           | object  | This contains information on how to process the PIN on the physical SIM. Note that this is only for operators that support PIN Top-up. |
| `balanceInfo`                                                       | object  | Balance information before and after the top-up                                                                                        |
