Airtime
Search…
Get the status of a top-up
With the /{{transactionId}}/status endpoint, the status of a top-up can be determined in real-time
get
https://topups.reloadly.com
/topups/{{transactionId}}/status
Top-up status

Request samples

cURL
C#
Golang
Java
Node JS
PHP
Python
1
curl --location -g --request GET 'https://topups.reloadly.com/topups/{{transactionId}}/status' \
2
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
3
--header 'Accept: application/com.reloadly.topups-v1+json'
Copied!
1
using System;
2
using System.Threading.Tasks;
3
using System.Net.Http;
4
using System.Text;
5
using Newtonsoft.Json;
6
7
namespace WebAPIClient {
8
class Program {
9
10
static async Task Main(string[] args) {
11
await ApiCall();
12
}
13
14
private static async Task ApiCall() {
15
16
var message = new HttpRequestMessage(HttpMethod.Get, "https://topups.reloadly.com/topups/{{transactionId}}/status");
17
18
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
19
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
20
21
using
22
var httpClient = new HttpClient();
23
var response = await httpClient.SendAsync(message);
24
var responseBody = await response.Content.ReadAsStringAsync();
25
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
26
27
Console.WriteLine(result);
28
}
29
30
}
31
}
Copied!
1
package main
2
3
import (
4
"fmt"
5
"net/http"
6
"io/ioutil"
7
)
8
9
func main() {
10
11
url := "https://topups.reloadly.com/topups/{{transactionId}}/status"
12
method := "GET"
13
14
client := &http.Client {
15
}
16
req, err := http.NewRequest(method, url, nil)
17
18
if err != nil {
19
fmt.Println(err)
20
return
21
}
22
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
23
req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")
24
25
res, err := client.Do(req)
26
if err != nil {
27
fmt.Println(err)
28
return
29
}
30
defer res.Body.Close()
31
32
body, err := ioutil.ReadAll(res.Body)
33
if err != nil {
34
fmt.Println(err)
35
return
36
}
37
fmt.Println(string(body))
38
}
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
Request request = new Request.Builder()
4
.url("https://topups.reloadly.com/topups/{{transactionId}}/status")
5
.method("GET", null)
6
.addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
7
.addHeader("Accept", "application/com.reloadly.topups-v1+json")
8
.build();
9
Response response = client.newCall(request).execute();
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://topups.reloadly.com/topups/{{transactionId}}/status',
5
'headers': {
6
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
7
'Accept': 'application/com.reloadly.topups-v1+json'
8
}
9
};
10
request(options, function (error, response) {
11
if (error) throw new Error(error);
12
console.log(response.body);
13
});
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://topups.reloadly.com/topups/%7B%7BtransactionId%7D%7D/status',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
16
'Accept: application/com.reloadly.topups-v1+json'
17
),
18
));
19
20
$response = curl_exec($curl);
21
22
curl_close($curl);
23
echo $response;
Copied!
1
import requests
2
import json
3
4
url = "https://topups.reloadly.com/topups/{{transactionId}}/status"
5
6
payload={}
7
headers = {
8
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
9
'Accept': 'application/com.reloadly.topups-v1+json'
10
}
11
12
response = requests.request("GET", url, headers=headers, data=payload)
13
14
print(response.text)
Copied!

Response parameters

Parameter
Type
Description
transactionId
integer
Indicates the unique ID of a top-up
status
string
Indicates the status of a top-up.
Note:
SUCCESSFUL: This applies when the top up is successfully made.
PROCESSING: This applies while the top up is still being verified from the operator's end.
REFUNDED: This applies once the top up is not processed successfully from the airtime operator's end. In this instance, any funds debited from a user's wallet while attempting to make the top-up are automatically refunded. FAILED: This applies when the top-up attempt fails due to an internal error from the operator's end. In this instance, you should wait 30 minutes before reinitiating the top-up. Funds are not debited for a failed top-up attempt.
operator
TransactionId
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
recipientPhone
string
This indicates the top-up receiver's mobile number
recipientEmail
string
This indicates the top-up receiver's email (only applicable to Nauta Cuba top-ups)
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
discount
integer
Indicates if there was a discount on the top-up made and at what rate
discountCurrency
Code
string
Indicates the currency code of the receiving mobile number
requestedAmount
integer
Indicates the top-up amount sent by the originating account
requestedAmount
CurrencyCode
string
Indicates the currency code of the originating account
deliveredAmount
integer
Indicates the top-up amount received by the receiving mobile number
deliveredAmount
CurrencyCode
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
serial
string
Indicates the serial code of the PIN top-up