Airtime
Search…
Make an asynchronous top-up
Using the /topup-async endpoint, developers have a faster way to view the status of every top-up that they make in real-time
For every asynchronous top-up that is made, a transaction ID is the only parameter returned as a response. This transaction ID can be used to confirm if the top-up request is successful, still processing, or failed
post
https://topups.reloadly.com
/topups-async
Async top-up

Request samples

cURL
C#
Golang
Java
Node JS
PHP
Python
1
curl --location --request POST 'https://topups.reloadly.com/topups-async' \
2
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
3
--header 'Accept: application/com.reloadly.topups-v1+json' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"operatorId":"341",
7
"amount":"10",
8
"useLocalAmount": false,
9
"customIdentifier": "This is example identifier 092",
10
"recipientPhone": {
11
"countryCode": "NG",
12
"number": "08147658721"
13
},
14
"senderPhone": {
15
"countryCode": "CA",
16
"number": "1231231231"
17
}
18
}'
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 json = JsonConvert.SerializeObject(new {
17
operatorId = "341",
18
amount = "10",
19
useLocalAmount = false,
20
customIdentifier = "This is a sample",
21
recipientPhone = new {
22
countryCode = "NG",
23
number = "08147658721"
24
}
25
});
26
27
var message = new HttpRequestMessage(HttpMethod.Post, "https://topups.reloadly.com/topups-async"){
28
Content = new StringContent(json, Encoding.UTF8, "application/json")
29
};
30
31
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
32
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
33
34
using
35
var httpClient = new HttpClient();
36
var response = await httpClient.SendAsync(message);
37
var responseBody = await response.Content.ReadAsStringAsync();
38
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
39
40
Console.WriteLine(result);
41
}
42
43
}
44
}
Copied!
1
package main
2
3
import (
4
"fmt"
5
"strings"
6
"net/http"
7
"io/ioutil"
8
)
9
10
func main() {
11
12
url := "https://topups.reloadly.com/topups-async"
13
method := "POST"
14
15
payload := strings.NewReader(`{
16
"operatorId":"341",
17
"amount":"10",
18
"useLocalAmount": false,
19
"customIdentifier": "This is example identifier 092",
20
"recipientPhone": {
21
"countryCode": "NG",
22
"number": "08147658721"
23
},
24
"senderPhone": {
25
"countryCode": "CA",
26
"number": "1231231231"
27
}
28
}`)
29
30
client := &http.Client {
31
}
32
req, err := http.NewRequest(method, url, payload)
33
34
if err != nil {
35
fmt.Println(err)
36
return
37
}
38
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
39
req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")
40
req.Header.Add("Content-Type", "application/json")
41
42
res, err := client.Do(req)
43
if err != nil {
44
fmt.Println(err)
45
return
46
}
47
defer res.Body.Close()
48
49
body, err := ioutil.ReadAll(res.Body)
50
if err != nil {
51
fmt.Println(err)
52
return
53
}
54
fmt.Println(string(body))
55
}
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
MediaType mediaType = MediaType.parse("application/json");
4
RequestBody body = RequestBody.create(mediaType, "{\n\t\"operatorId\":\"685\",\n\t\"amount\":\"10\",\n\t\"customIdentifier\": \"This is example identifier 092\",\n\t\"recipientPhone\": {\n\t\t\"countryCode\": \"NG\",\n\t\t\"number\": \"08147658721\"\n\t},\n\t\"senderPhone\": {\n\t\t\"countryCode\": \"CA\",\n\t\t\"number\": \"1231231231\"\n\t}\n}");
5
Request request = new Request.Builder()
6
.url("https://topups.reloadly.com/topups-async")
7
.method("POST", body)
8
.addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
9
.addHeader("Accept", "application/com.reloadly.topups-v1+json")
10
.addHeader("Content-Type", "application/json")
11
.build();
12
Response response = client.newCall(request).execute();
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://topups.reloadly.com/topups-async',
5
'headers': {
6
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
7
'Accept': 'application/com.reloadly.topups-v1+json',
8
'Content-Type': 'application/json'
9
},
10
body: JSON.stringify({
11
"operatorId": "341",
12
"amount": "10",
13
"useLocalAmount": false,
14
"customIdentifier": "This is example identifier 092",
15
"recipientPhone": {
16
"countryCode": "NG",
17
"number": "08147658721"
18
},
19
"senderPhone": {
20
"countryCode": "CA",
21
"number": "1231231231"
22
}
23
})
24
25
};
26
request(options, function (error, response) {
27
if (error) throw new Error(error);
28
console.log(response.body);
29
});
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://topups.reloadly.com/topups-async',
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 => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"operatorId":"341",
16
"amount":"10",
17
"useLocalAmount": false,
18
"customIdentifier": "This is example identifier 092",
19
"recipientPhone": {
20
"countryCode": "NG",
21
"number": "08147658721"
22
},
23
"senderPhone": {
24
"countryCode": "CA",
25
"number": "1231231231"
26
}
27
}',
28
CURLOPT_HTTPHEADER => array(
29
'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
30
'Accept: application/com.reloadly.topups-v1+json',
31
'Content-Type: application/json'
32
),
33
));
34
35
$response = curl_exec($curl);
36
37
curl_close($curl);
38
echo $response;
Copied!
1
import requests
2
import json
3
4
url = "https://topups.reloadly.com/topups-async"
5
6
payload = json.dumps({
7
"operatorId": "341",
8
"amount": "10",
9
"useLocalAmount": False,
10
"customIdentifier": "This is example identifier 092",
11
"recipientPhone": {
12
"countryCode": "NG",
13
"number": "08147658721"
14
},
15
"senderPhone": {
16
"countryCode": "CA",
17
"number": "1231231231"
18
}
19
})
20
headers = {
21
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
22
'Accept': 'application/com.reloadly.topups-v1+json',
23
'Content-Type': 'application/json'
24
}
25
26
response = requests.request("POST", url, headers=headers, data=payload)
27
28
print(response.text)
Copied!

Request samples for Nauta Cuba top-ups

cURL
C#
Golang
Java
Node JS
PHP
Python
1
curl --location --request POST 'https://topups.reloadly.com/topups-async' \
2
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
3
--header 'Accept: application/com.reloadly.topups-v1+json' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"operatorId":"685",
7
"amount":"10",
8
"customIdentifier": "This is example identifier 092",
9
"recipientEmail": "[email protected]",
10
"senderPhone": {
11
"countryCode": "CA",
12
"number": "1231231231"
13
}
14
}'
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 json = JsonConvert.SerializeObject(new {
17
operatorId = "685",
18
amount = "10",
19
customIdentifier = "This is a sample",
20
recipientEmail = "[email protected]"
21
senderPhone = new {
22
countryCode = "CA",
23
number = "1231231231"
24
}
25
});
26
27
var message = new HttpRequestMessage(HttpMethod.Post, "https://topups.reloadly.com/topups-async"){
28
Content = new StringContent(json, Encoding.UTF8, "application/json")
29
};
30
31
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
32
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
33
34
using
35
var httpClient = new HttpClient();
36
var response = await httpClient.SendAsync(message);
37
var responseBody = await response.Content.ReadAsStringAsync();
38
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
39
40
Console.WriteLine(result);
41
}
42
43
}
44
}
Copied!
1
package main
2
3
import (
4
"fmt"
5
"strings"
6
"net/http"
7
"io/ioutil"
8
)
9
10
func main() {
11
12
url := "https://topups.reloadly.com/topups-async"
13
method := "POST"
14
15
payload := strings.NewReader(`{
16
"operatorId":"685",
17
"amount":"10",
18
"customIdentifier": "This is example identifier 092",
19
"recipientEmail": "[email protected]",
20
"senderPhone": {
21
"countryCode": "CA",
22
"number": "1231231231"
23
}
24
}`)
25
26
client := &http.Client {
27
}
28
req, err := http.NewRequest(method, url, payload)
29
30
if err != nil {
31
fmt.Println(err)
32
return
33
}
34
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
35
req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")
36
req.Header.Add("Content-Type", "application/json")
37
38
res, err := client.Do(req)
39
if err != nil {
40
fmt.Println(err)
41
return
42
}
43
defer res.Body.Close()
44
45
body, err := ioutil.ReadAll(res.Body)
46
if err != nil {
47
fmt.Println(err)
48
return
49
}
50
fmt.Println(string(body))
51
}
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
MediaType mediaType = MediaType.parse("application/json");
4
RequestBody body = RequestBody.create(mediaType, "{\n\t\"operatorId\":\"685\",\n\t\"amount\":\"10\",\n\t\"customIdentifier\": \"This is example identifier 092\",\n\t\"recipientEmail\": \"[email protected]\",\n\t\"senderPhone\": {\n\t\t\"countryCode\": \"CA\",\n\t\t\"number\": \"1231231231\"\n\t}\n}");
5
Request request = new Request.Builder()
6
.url("https://topups.reloadly.com/topups-async")
7
.method("POST", body)
8
.addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
9
.addHeader("Accept", "application/com.reloadly.topups-v1+json")
10
.addHeader("Content-Type", "application/json")
11
.build();
12
Response response = client.newCall(request).execute();
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://topups.reloadly.com/topups-async',
5
'headers': {
6
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
7
'Accept': 'application/com.reloadly.topups-v1+json',
8
'Content-Type': 'application/json'
9
},
10
body: JSON.stringify({
11
"operatorId": "685",
12
"amount": "10",
13
"customIdentifier": "This is example identifier 092",
14
"recipientEmail": "[email protected]",
15
"senderPhone": {
16
"countryCode": "CA",
17
"number": "1231231231"
18
}
19
})
20
21
};
22
request(options, function (error, response) {
23
if (error) throw new Error(error);
24
console.log(response.body);
25
});
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://topups.reloadly.com/topups-async',
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 => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"operatorId":"685",
16
"amount":"10",
17
"customIdentifier": "This is example identifier 092",
18
"recipientEmail": "[email protected]",
19
"senderPhone": {
20
"countryCode": "CA",
21
"number": "1231231231"
22
}
23
}',
24
CURLOPT_HTTPHEADER => array(
25
'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
26
'Accept: application/com.reloadly.topups-v1+json',
27
'Content-Type: application/json'
28
),
29
));
30
31
$response = curl_exec($curl);
32
33
curl_close($curl);
34
echo $response;
Copied!
1
import requests
2
import json
3
4
url = "https://topups.reloadly.com/topups-async"
5
6
payload = json.dumps({
7
"operatorId": "685",
8
"amount": "10",
9
"customIdentifier": "This is example identifier 092",
10
"recipientEmail": "[email protected]",
11
"senderPhone": {
12
"countryCode": "CA",
13
"number": "1231231231"
14
}
15
})
16
headers = {
17
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
18
'Accept': 'application/com.reloadly.topups-v1+json',
19
'Content-Type': 'application/json'
20
}
21
22
response = requests.request("POST", url, headers=headers, data=payload)
23
24
print(response.text)
Copied!

Response parameters

Parameter
Type
Description
transactionId
integer
Indicates the unique ID of an asynchronous top-up which is used to confirm its status
Flowchart for an asynchronous top-up