DevTools
Search…
Sandbox
Reloadly provides a virtual sandbox where you can simulate real-like scenarios of our products. To get started, you will need test credentials. You can get these from your dashboard. Below is an outline of the steps you can take to use the sandbox tool

First, navigate to your dashboard and turn on test mode in the sidebar

Next, still on the sidebar - navigate to Developers > API settings

When this is done, use the client ID and secret to retrieve your test access token.

The audience parameter to be used when requesting a test access token varies according to the product test environment you need to access
Product
Audience
Token Lifespan
Airtime
https://topups-sandbox.reloadly.com
86400 seconds
GiftCard
https://giftcards-sandbox.reloadly.com
5184000 seconds
cURL
C#
Golang
Java
Node JS
PHP
Python
1
curl --location --request POST 'https://auth.reloadly.com/oauth/token' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"client_id": "YOUR_CLIENT_ID_HERE",
5
"client_secret": "YOUR_CLIENT_SECRET_HERE",
6
"grant_type":"client_credentials",
7
"audience":"INSERT_THE_APPROPRIATE_AUDIENCE"
8
}'
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
var json = JsonConvert.SerializeObject(new {
16
client_id = "YOUR_CLIENT_ID_HERE",
17
client_secret = "YOUR_CLIENT_SECRET_HERE",
18
grant_type = "client_credentials",
19
audience = "INSERT_THE_APPROPRIATE_AUDIENCE"
20
});
21
22
var message = new HttpRequestMessage(HttpMethod.Post, "https://auth.reloadly.com/oauth/token"){
23
Content = new StringContent(json, Encoding.UTF8, "application/json")
24
};
25
26
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
27
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
28
29
using
30
var httpClient = new HttpClient();
31
var response = await httpClient.SendAsync(message);
32
var responseBody = await response.Content.ReadAsStringAsync();
33
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
34
35
Console.WriteLine(result);
36
}
37
38
}
39
}
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://auth.reloadly.com/oauth/token"
13
method := "POST"
14
15
payload := strings.NewReader(`{
16
"client_id":"YOUR_CLIENT_ID_HERE",
17
"client_secret":"YOUR_CLIENT_SECRET_HERE",
18
"grant_type":"client_credentials",
19
"audience":"INSERT_THE_APPROPRIATE_AUDIENCE"
20
}`)
21
22
client := &http.Client {
23
}
24
req, err := http.NewRequest(method, url, payload)
25
26
if err != nil {
27
fmt.Println(err)
28
return
29
}
30
req.Header.Add("Content-Type", "application/json")
31
32
res, err := client.Do(req)
33
if err != nil {
34
fmt.Println(err)
35
return
36
}
37
defer res.Body.Close()
38
39
body, err := ioutil.ReadAll(res.Body)
40
if err != nil {
41
fmt.Println(err)
42
return
43
}
44
fmt.Println(string(body))
45
}
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
MediaType mediaType = MediaType.parse("application/json");
4
RequestBody body = RequestBody.create(mediaType, "{\n\t\"client_id\":\"YOUR_CLIENT_ID_HERE\",\n\t\"client_secret\":\"YOUR_CLIENT_SECRET_HERE\",\n\t\"grant_type\":\"client_credentials\",\n\t\"audience\":\"INSERT_THE_APPROPRIATE_AUDIENCE\"\n}");
5
Request request = new Request.Builder()
6
.url("https://auth.reloadly.com/oauth/token")
7
.method("POST", body)
8
.addHeader("Content-Type", "application/json")
9
.build();
10
Response response = client.newCall(request).execute();
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://auth.reloadly.com/oauth/token',
5
'headers': {
6
'Content-Type': 'application/json'
7
},
8
body: JSON.stringify({
9
"client_id": "YOUR_CLIENT_ID_HERE",
10
"client_secret": "YOUR_CLIENT_SECRET_HERE",
11
"grant_type": "client_credentials",
12
"audience": "INSERT_THE APPROPRIATE_AUDIENCE"
13
})
14
15
};
16
request(options, function (error, response) {
17
if (error) throw new Error(error);
18
console.log(response.body);
19
});
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://auth.reloadly.com/oauth/token',
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
"client_id":"YOUR_CLIENT_ID_HERE",
16
"client_secret":"YOUR_CLIENT_SECRET_HERE",
17
"grant_type":"client_credentials",
18
"audience":"INSERT_THE_APPROPRIATE_AUDIENCE"
19
}',
20
CURLOPT_HTTPHEADER => array(
21
'Content-Type: application/json'
22
),
23
));
24
25
$response = curl_exec($curl);
26
27
curl_close($curl);
28
echo $response;
Copied!
1
import requests
2
import json
3
4
url = "https://auth.reloadly.com/oauth/token"
5
6
payload = json.dumps({
7
"client_id": "YOUR_CLIENT_ID_HERE",
8
"client_secret": "YOUR_CLIENT_SECRET_HERE",
9
"grant_type": "client_credentials",
10
"audience": "INSERT_THE_APPROPRIATE_AUDIENCE"
11
})
12
headers = {
13
'Content-Type': 'application/json'
14
}
15
16
response = requests.request("POST", url, headers=headers, data=payload)
17
18
print(response.text)
Copied!
If the request is successfully made, you will get a test access token.
JSON
1
{
2
"access_token": "eyJraWQiOiI1N2JjZjNhNy01YmYwLTQ1M2QtODQ0Mi03ODhlMTA4OWI3MDIiLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2NzkzIiwiaXNzIjoiaHR0cHM6Ly9yZWxvYWRseS1zYW5kYm94LmF1dGgwLmNvbS8iLCJodHRwczovL3JlbG9hZGx5LmNvbS9zYW5kYm94Ijp0cnVlLCJodHRwczovL3JlbG9hZGx5LmNvbS9wcmVwYWlkVXNlcklkIjoiNjc5MyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsImF1ZCI6Imh0dHBzOi8vdG9wdXBzLWhzMjU2LXNhbmRib3gucmVsb2FkbHkuY29tIiwibmJmIjoxNjI1MTMxNjIyLCJhenAiOiI2NzkzIiwic2NvcGUiOiJzZW5kLXRvcHVwcyByZWFkLW9wZXJhdG9ycyByZWFkLXByb21vdGlvbnMgcmVhZC10b3B1cHMtaGlzdG9yeSByZWFkLXByZXBhaWQtYmFsYW5jZSByZWFkLXByZXBhaWQtY29tbWlzc2lvbnMiLCJleHAiOjE2MjUyMTgwMjIsImh0dHBzOi8vcmVsb2FkbHkuY29tL2p0aSI6IjVhNzNlZTdjLTBlYWQtNGM0Ny1iOTZhLWY3MGRmNjk2ZDI3YiIsImlhdCI6MTYyNTEzMTYyMiwianRpIjoiNTc2ZTFkMDUtMTczNy00ZGRkLWIwY2YtY2ZhMDQwYzc3M2E4In0.ZFphWtZ3WKXfmBYO6xTQTV0kCj-Ek0alYOlB2MDWIr0",
3
"scope": "send-topups read-operators read-promotions read-topups-history read-prepaid-balance read-prepaid-commissions",
4
"expires_in": 86400,
5
"token_type": "Bearer"
6
}
Copied!
Note that the same access token cannot be used for different product test environments.

Finally, you can access the test environment by making requests to the product test audience

cURL
C#
Golang
Java
Node JS
PHP
Python
1
curl --location --request POST 'https://topups-sandbox.reloadly.com/topups' \
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-sandbox.reloadly.com/topups"){
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-sandbox.reloadly.com/topups"
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-sandbox.reloadly.com/topups")
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-sandbox.reloadly.com/topups',
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-sandbox.reloadly.com/topups',
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-sandbox.reloadly.com/topups"
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!
Copy link
Contents