# Search Transactions

This API request lists transactions performed on the merchant API backend.

All transactions performed for the merchant (in any shop) between 2 dates and times are listed in the response.

Filtering for a specific voucher or type of action is to be done on the extracted data by the merchant.

# Transaction Types

The transaction types returned by this API call are:

The redeem voucher action has two transactions logged in the backend. The capture transaction confirms the successful redemption of the voucher.

# Main Available Search Filter

  • from and to: date and time of the start and end limits of the search in ISO (opens new window) YYYY-MM-DDThh:mm:ssTZD format.
  • page_size: the limit number of transactions to be returned in the response.
  • page_index: the pagination index of the returned list of transactions (limited by page_size).

Some other optional filters are available and documented in the Technical Documentation (opens new window).

# Other Request Parameters

  • X-Client-Id and X-Client-Secret: credentials of the shop interacting with the API, see also Authentication.

# Information Returned

  • status: confirming that the search request has been successfully executed.
  • data: containing a JSON list of transactions on the merchant API. Transactions returned sorted from most recent to oldest.

# Date and Time Format in Response

All date and time returned are in ISO (opens new window) YYYY-MM-DDThh:mm:ss.s format in UTC timezone.

# Transactions Information Returned

  • transaction_id: the ID of the transaction corresponding to the authorization_id, capture_id or refund_id returned in previous transactions.
  • status: the status of the transaction listed.
  • type: the type of the transaction listed. See as well Transaction Types.
  • mid: the merchant ID of the transaction.
  • amount: the amount in cents of the transaction if any.
  • currency: the currency in cents of the transaction if any.
  • created and last_updated: date and time of the transaction creation and last backend update (for longer transactions).
  • vouchers: the details of the voucher impacted by the transaction, see Vouchers Information Returned.

# Vouchers Information Returned

  • ref: unique reference displayed on the voucher.
  • product_class: reference to the catalogue of products.
  • product_code: Unique code that identifies the product used to issue the voucher.
  • product_label: The name of the product.
  • using_value: the amount.
  • actions: a data structure with details of the response received during at the transaction time.

# Example of an API Call

# API Endpoint and Headers

POST https://api.merchant.demo.uniqrewards.com/v1/transactions/actions/search

Headers:
X-Client-Id: a1f64ebc9c4fef739df58f5933ceec94
X-Client-Secret: 1231f6112bbff1b03892306f53281bb0
Content-Type: application/json

# Request Body

{
    "from": "2022-01-10T00:00:00+08:00",
    "to": "2022-01-10T23:59:59+08:00",
    "page_size": 10,
    "page_index": 0
}

# Response Body

{
    "data": [
        {
            "transaction_id": "0000100000000000017120220110002801005",
            "status": "succeeded",
            "type": "Other",
            "mid": "000000000000171",
            "amount": 1,
            "currency": "SGD",
            "created": "2022-01-10T06:10:43.65",
            "last_updated": "2022-01-10T06:10:43.65",
            "vouchers": [
                {
                    "ref": "1701221318",
                    "product_class": "ETX_001",
                    "product_code": "MAMVDDMMYY01",
                    "product_label": "$10 UNIQGIFT Value Based Test Voucher",
                    "using_value": 1,
                    "actions": [
                        {
                            "ref": "0000100000000000017120220110002801005",
                            "type": "Other",
                            "status": "succeeded",
                            "codes": [
                                "ERV0000"
                            ],
                            "timestamp": "2022-01-10T06:10:43.65"
                        }
                    ]
                }
            ]
        }
    ],
    "meta": {
        "status": "succeeded"
    }
}

Note: the sample values in this page are mock-up values. They are not valid credentials and they are not associated to any actual product or voucher.

More details can be found on the Technical Documentation (opens new window).