How to order a gift card

Raphael Ugwu

Raphael Ugwu

4 min

The most important aspect of Reloadly’s GiftCard API is ordering a gift card. This guide will show you how to:

  • View your preferred gift card
  • Place an order for it
  • Get its code delivered to an email address/mobile number 
  • View the redeem instructions for the gift card

Steps we will take in this guide are:

  • Getting your access token
  • Getting the list of gift cards available in your preferred country
  • Getting the product ID and brand ID of your preferred gift card
  • Ordering your gift card
  • Viewing the redeem instructions of your ordered gift card

You can get your access token by following the steps in this quickstart.

Getting the list of gift cards available in your preferred country

Supposing you are located in Nigeria and wanted to send a gift card to a friend in Brazil, your first step is to access every gift card that’s available in Brazil – you can achieve this by making a request to Reloadly’s GiftCard API with Brazil’s two-letter ISO code. The cURL code sample below shows how this can be achieved

curl -i -X GET \
  https://giftcards-sandbox.reloadly.com/countries/BR/products \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

If successful, you will receive a response similar to the JSON snippet below

[
    {
      "productId": 3058,
      "productName": "Free Fire 100 + 10 Diamond BR",
      "global": false,
      "senderFee": 285,
      "discountPercentage": 2.9,
      "denominationType": "FIXED",
      "recipientCurrencyCode": "USD",
      "minRecipientDenomination": null,
      "maxRecipientDenomination": null,
      "senderCurrencyCode": "NGN",
      "minSenderDenomination": null,
      "maxSenderDenomination": null,
      "fixedRecipientDenominations": [
        1
      ],
      "fixedSenderDenominations": [
        570
      ],
      "fixedRecipientToSenderDenominationsMap": {
        "1.00": 570
      },
      "logoUrls": [
        "https://cdn.reloadly.com/giftcards/c722d3a0-3e51-421e-a30a-51680a40e6ae.jpg"
      ],
      "brand": {
        "brandId": 22,
        "brandName": "Free Fire"
      },
      "country": {
        "isoName": "BR",
        "name": "Brazil",
        "flagUrl": "https://s3.amazonaws.com/rld-flags/br.svg"
      },
      "redeemInstruction": {
        "concise": "Redeem the Free Fire code online at https://shop.garena.sg/app",
        "verbose": "Only Player ID & Nickname is needed for Garena Free Fire Diamonds top-up. You may stay logged in throughout the transaction, once the top-up is completed, you will receive the Diamonds in your Garena Free Fire account. 
Please enter your Player ID & Nickname correctly to avoid delay on Diamonds top-up. 
Follow these simple steps to get your diamonds by redeeming the Free Fire code online: https://shop.garena.sg/app 
-Select Free Fire 
-Log into your account either through linked social media or by entering your Player ID. 
-Select Garena Voucher 
-Enter the code you received from us. 
-The diamonds will then be visible in your Free Fire account."
      }
    }
]

Getting the product ID and brand ID of your preferred gift card

In the JSON response that contains gift cards available in Brazil, scan for the gift card you want to order. Once you find it, take note of its productId, brandId and recipientCurrencyCode values. Let’s take a moment to understand what these values mean:

  • productId: The identification number of the gift card product line
  • brandId: The identification number of the particular brand you are interested in. A gift card product may have one or more brands. For example, Amazon’s gift card product can have the Amazon UK brand and the Amazon US brand
  • recipientCurrencyCode: The currency denomination which is accepted as payment for this gift card. If this is a currency different from your account’s local currency, an exchange rate will be applied for your purchase

For this guide, we will use the productId and brandId of the Free Fire 100 + 10 Diamond BR gift card returned in the JSON response. From the response, the values for this gift card are

{
  “productId”: 3058,
  “brandId”: 22,
  “recipientCurrencyCode”: “USD”
}

Ordering your gift card

After identifying the product details of the gift card in Brazil you want to order, you can make your order by placing a request to Reloadly’s GiftCard API using the following parameters

  • The product ID of your preferred gift card
  • The two letter ISO code of your current location
  • The quantity of gift cards you want to order
  • The price of the gift card (in USD value – see recipientCurrencyCode)
  • The name of the gift card sender – you can use your name or your company’s name here
  • The recipient’s email address 

Optionally, you can add the recipient’ phone number if you want the gift card code to be sent as an SMS to them. The cURL code snippet below shows how to combine these parameters to order a gift card

curl -i -X POST \
  https://giftcards-sandbox.reloadly.com/orders \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "productId": 3058,
    "countryCode": "NG",
    "quantity": 1,
    "unitPrice": 1,
    "customIdentifier": "brazil-gift-card",
    "senderName": "John Doe",
    "recipientEmail": "anyone@email.com",
    "recipientPhoneDetails": {
      "countryCode": "BR",
      "phoneNumber": "15932093432"
    }
  }'

Once successful, you will get a response similar to the JSON snippet below

{
  "transactionId": 3394,
  "amount": 892.64,
  "discount": 16.53,
  "currencyCode": "NGN",
  "fee": 285,
  "smsFee": 37.64,
  "recipientEmail": "anyone@email.com",
  "recipientPhone": "5515932093432",
  "customIdentifier": "brazil-gift-card",
  "status": "SUCCESSFUL",
  "transactionCreatedTime": "2022-07-04 05:15:37",
  "product": {
    "productId": 3058,
    "productName": "Free Fire 100 + 10 Diamond BR",
    "countryCode": "BR",
    "quantity": 1,
    "unitPrice": 1,
    "totalPrice": 1,
    "currencyCode": "USD",
    "brand": {
      "brandId": 22,
      "brandName": "Free Fire"
    }
  }
}

At this point, the gift card code has been sent to the email and phone number you specified. Let’s learn how to utilize the code and redeem the gift card in the next step.

Viewing the redeem instructions of your ordered gift card 

Your gift card has been sent to your friend in Brazil. However there’s one last thing – they need to know how to redeem the gift card. Every gift card on Reloadly has a series of redeem instructions which can be seen by  making a request with the gift card’s brand ID. 

Remember we specified the brand ID of our Brazilian gift card earlier in this guide. Now let’s use that brand ID to make a request to retrieve the necessary instructions for redeeming this gift card. The cURL code snippet below shows how this can be done:

curl -i -X GET \
  https://giftcards-sandbox.reloadly.com/redeem-instructions/22 \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

If successful, you will get a JSON response containing instructions on how to redeem the Brazilian gift card

{
  "brandId": 22,
  "brandName": "Free Fire",
  "concise": "Redeem the Free Fire code online at https://shop.garena.sg/app",
  "verbose": "Only Player ID & Nickname is needed for Garena Free Fire Diamonds top-up. You may stay logged in throughout the transaction, once the top-up is completed, you will receive the Diamonds in your Garena Free Fire account. 
Please enter your Player ID & Nickname correctly to avoid delay on Diamonds top-up. 
Follow these simple steps to get your diamonds by redeeming the Free Fire code online: https://shop.garena.sg/app 
-Select Free Fire 
-Log into your account either through linked social media or by entering your Player ID. 
-Select Garena Voucher 
-Enter the code you received from us. 
-The diamonds will then be visible in your Free Fire account."
}

This guide can then be emailed to your friend to help them in using the gift card.

Resources

Reloadly Gift Cards API

Reloadly Developer Documentation

This might also interest you:

Content by developers to developers.

Subscribe to The Monthly Reload for Developers and start receiving all the developers’ updates.

The Monthly Reload: the newsletter for you

Subscribe to our Newsletter and don’t miss any news about our industry and products.

It’s time to build, make your first API call today