How to fetch monthly transaction data for gift card orders made on your account

Raphael Ugwu

Raphael Ugwu

< 1

It’s essential to track your gift card orders, especially if you make lots of orders over an amount of time. This guide will walk you through how to achieve this. Steps to be followed in this guide are:

  • Getting your access token
  • Retrieving monthly gift card transaction details

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

Retrieving monthly gift card transaction details

Assuming you want to view the gift card transaction details for the month of June 2022, you can achieve this by making a request to Reloadly’s GiftCard API with the starting date and the ending date of the specified month. You would also specify the time – for example, the query parameters to be specified for June 2022 would be as follows

startDate: 2022-06-01 00:00:01

endDate: 2022-06-30 23:59:59

The cURL code snippet below shows how the entire request is put together

'https://giftcards-sandbox.reloadly.com/reports/transactions?startDate=2022-06-01%2000%3A00%3A01&endDate=2022-06-30%2023%3A59%3A59' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

If successful, you will receive a JSON snippet containing details of all the gift card orders you made in June 2022

{
  "content": [
    {
      "transactionId": 3116,
      "amount": 3139.45,
      "discount": 25.65,
      "currencyCode": "NGN",
      "fee": 285,
      "smsFee": 4.45,
      "recipientEmail": "anyone@email.com",
      "recipientPhone": "18579184613",
      "customIdentifier": "gift-card-amazon-order",
      "status": "SUCCESSFUL",
      "transactionCreatedTime": "2022-06-10 08:06:04",
      "product": {
        "productId": 5,
        "productName": "Amazon US",
        "countryCode": "US",
        "quantity": 1,
        "unitPrice": 5,
        "totalPrice": 5,
        "currencyCode": "USD",
        "brand": {
          "brandId": 2,
          "brandName": "Amazon"
        }
      }
    }
  ],
  "pageable": {
    "sort": {
      "sorted": false,
      "unsorted": true,
      "empty": true
    },
    "pageNumber": 0,
    "pageSize": 50,
    "offset": 0,
    "unpaged": false,
    "paged": true
  },
  "last": true,
  "totalPages": 1,
  "totalElements": 1,
  "sort": {
    "sorted": false,
    "unsorted": true,
    "empty": true
  },
  "numberOfElements": 1,
  "first": true,
  "size": 50,
  "number": 0,
  "empty": false
}

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