GiftCards
Search…
Order a gift card
With the /orders endpoint, you can make a request to purchase any of the gift card products made available via Reloadly
post
https://giftcards.reloadly.com
/orders
Order GiftCard
Note that when making a request to the /orders endpoint, either the recipientEmail or the recipientPhoneDetails parameters can be used.

Request samples

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

Response parameters

Parameter
Type
Description
transactionId
integer
Indicates the unique ID of a gift card transaction
amount
integer
Indicates the amount deducted for the purchase of the gift card plus fees incurred
discount
integer
Indicates the discount applied - if there was any - at the point of purchasing the gift card
currencyCode
string
This is the currency denomination of the user's account
recipientEmail
string
Indicates the email address of the gift card's recipient
customIdentifier
string
This is a unique reference assigned to the gift card at the point of purchase
status
string
Indicates the status of the transaction
transaction
CreatedTime
string
Indicates the date the transaction was made
product
object
This is an object that contains all details of the gift card transaction that was made
productId
integer
This indicates the product ID of the gift card
productName
string
This indicates the gift card's name
countryCode
string
Indicates the ISO code of the country where the purchased gift card can be used
quantity
integer
Indicates the number of gift cards that were purchased in a single transaction
unitPrice
integer
Indicates the gift card price
totalPrice
integer
Indicates the total price at which the gift cards were purchased
currencyCode
string
This is the currency denomination in which the gift card was purchased
brand
object
This is an object that contains all details of the gift card brand(s) purchased
brandId
integer
This indicates the ID of the gift card brand purchased
brandName
string
This indicates the name of the gift card brand purchased
Flowchart for a giftcard order