Get Wallet Transactions

Learn how to use Get Wallet Transactions API to retrieve detailed user wallet transaction logs for efficient wallet management.

Overview

The Get Wallet Transactions API helps you to retrieve wallet transaction details for a specific user. You can integrate this API at relevant touchpoints within the application to display transaction details on the user interface.

This API provides the following information:

  • Transaction History: Includes a comprehensive log of all wallet transactions, that is, credits, debits, and expirations processed through various sources linked to the user's wallet.
  • Promised Points: Displays points yet to be credited to the user wallet based on their activation date. This allows users to monitor points scheduled for future credit. For example, if a user earns 100 points for a transaction with a 7-day activation period, these points remain in the Pending bucket until the activation period ends. After 7 days, they move to Active status and become redeemable.
  • Expiring Points: Displays points nearing expiration along with their expiry dates, helping users track and redeem them before they expire to avoid losing benefits.
  • System Keys and Metadata: Includes additional system keys such as, saleChannel, locationId, saleAmount, and orderId. A metadata object with key–value pairs is also returned, reflecting any data provided when the debit/credit transaction was created. If no metadata was associated, the field is returned as null.

Base URL

Here is an example base URL from the account in the India region:

https://in1.api.clevertap.com/1/promo/transactions

Region

To identify the API endpoint for your account region, refer to Region.

Headers

For more information about API headers used while processing API requests, refer to Headers.

HTTP Method

GET

Query Parameters

The API requires the following query parameters:

ParameterDescriptionTypeRequired/OptionalSample Value
identityIdentifies the user associated with the wallet.StringRequiredKMN@123
walletIdUnique identifier assigned to each user wallet within the application.StringRequiredwallet_123
pagePage number for paginated results. The default value is 1. The wallet transaction details are returned in a paginated format. You must pass the page number as a query parameter to retrieve specific pages. Each page can include up to 25 transactions.NumberOptional1
typeThe type of transaction to retrieve. Accepted values are credit, debit, expired, reverse, and refund. If not specified, the API returns transactions from all sources without filtering. Values are case-insensitive, meaning credit and CREDIT are treated as the same. You can pass multiple comma-separated values to filter for more than one type at once. For example, when using the filter type=credit,debit, it returns both credit and debit transactions.StringOptionalcredit, debit
txnSourceThe source through which the wallet transaction occurred. Accepted values are api, system, campaign, manual, cashbackcoupon. If not specified, the API returns transactions from all sources without filtering. Values are case-insensitive, meaning cashbackcoupon and CASHBACKCOUPON are treated as the same. Only one value is supported per request.StringOptionalcampaign
saleChannelThe sale channel recorded against credit and debit transactions. This is an open string value. Pass the value exactly as it was recorded. The filter is case-sensitive. For example, POS and pos are treated as different values. Spaces and special characters are accepted. For example, star-pos or star pos. Only one value is supported per request.StringOptionalstar-pos
campaignIdThe numeric ID of a CleverTap promo campaign. Pass this parameter to retrieve transactions associated with a specific campaign. Only one value is supported per request.IntegerOptional456
orderIdThe order ID recorded against credit and debit transactions. Pass this parameter to retrieve transactions associated with a specific order. Only one value is supported per request.StringOptionalORD-98123
locationIdThe location ID recorded against credit and debit transactions. Pass this parameter to retrieve transactions associated with a specific location. Only one value is supported per request.StringOptionalBAN-MG-ROAD
fromFilters transactions with a timestamp on or after this value. Pass the timestamp in UTC epoch format (seconds). If to is not provided, the API defaults the end time to the current timestamp. Filtering is inclusive, meaning the transactions matching exactly this timestamp are included.IntegerOptional1704067200
toFilters transactions with a timestamp on or before this value. Pass the timestamp in UTC epoch format (seconds). Must be used together with from. Filtering is inclusive, meaning the transactions matching exactly this timestamp are included.IntegerOptional1706745600
📘

Note

  • All filter parameters are optional. Filters not passed, or passed with blank or null values, are silently ignored.
  • Filters only apply to the allTransactions object in the response. The promisedPoints and pointsExpiring objects are not affected and always return their full data.
  • When no transactions match the applied filters, the allTransactions array returns empty. This is not an error.
  • All filter keys work together with AND logic by default.

Filter Behavior

The following rules apply when using query parameters to filter wallet transactions. Understanding these behaviors helps you combine filters correctly and avoid unexpected results.

ScenarioBehavior
Multiple filter keys use AND logicWhen you pass multiple filter keys, the API returns only transactions that match all conditions. For example, type=credit&txnSource=campaign returns only credit transactions that originated from a promo campaign.
type supports multiple comma-separated valuesYou can pass more than one value for type in a single request. For example, type=credit,debit returns both credit and debit transactions.
All other filter keys support only one valuePassing multiple values for orderId, saleChannel, txnSource, campaignId, or locationId returns an error.
type and txnSource are case-insensitivecredit and CREDIT are treated as the same. campaign and CAMPAIGN are treated as the same.
saleChannel is case-sensitivePOS and pos are treated as different values. Pass the value exactly as it was recorded at the time of the transaction.
Blank or null filter values are silently ignoredIf a filter key is passed with no value, it does not affect the results.
Filters apply only to allTransactionsThe promisedPoints and pointsExpiring objects in the response are not affected by any filter. They always return their full data, regardless of the filters applied.

Date Range Behavior

The from and to parameters let you filter transactions to a specific time window. Both values must be passed in UTC epoch format (seconds). The following rules define how the API handles different date range inputs.

ScenarioBehavior
Both from and to providedReturns transactions where fromtxnTimestampto. Both boundaries are inclusive.
Only from provided, to omittedThe API automatically uses the current timestamp as to. Returns all transactions from the given start time up to now.
Only to provided, from omittedReturns the to requires from error. to cannot be used without from.
fromis later than toReturns the Invalid date range error
Date passed as a formatted string instead of an epochReturns the Invalid date format, expected in epoch error
Invalid or non-numeric epoch valueReturns the Invalid date format error

For full-day filtering, pass from as 00:00:00 UTC and to as 23:59:59 UTC for the target date, converted to epoch. For example, to filter all transactions on January 1, 2024 (UTC), pass from=1704067200&to=1704153599.

Sample Request

Here is an example request to the Get Wallet Transactions API, including headers needed to authenticate the request:

curl -X GET "https://in1.api.clevertap.com/1/promo/transactions?identity=krishna123&walletId=2163" \
-H "X-CleverTap-Account-Id: ACCOUNT_ID" \
-H "X-CleverTap-Passcode: PASSCODE" \
-H "Content-Type: application/json" 
curl -X GET "https://in1.api.clevertap.com/1/promo/transactions?identity=krishna123&walletId=2163&type=credit,debit&txnSource=campaign&campaignId=456&from=1704067200&to=1706745600" \
  -H "X-CleverTap-Account-Id: ACCOUNT_ID" \
  -H "X-CleverTap-Passcode: PASSCODE" \
  -H "Content-Type: application/json"

Find CleverTap Account ID and Passcode

You can find the CleverTap Account ID and Passcode from the CleverTap dashboard by navigating to the Settings > Project page on the CleverTap dashboard.

Find CleverTap Project Details

Find CleverTap Project Details

Sample Response

The Get Wallet Transactions API response depends on query parameters, pagination settings, and transaction sources. The API returns an array of objects, with each object containing details about a specific transaction for the given walletId.

The following sample response returns the paginated list of transaction details:

{
  "status": "success",
  "record": {
    "allTransactions": [
      {
        "txnTimestamp": 1754386499,
        "saleAmount": 0,
        "metadata": null,
        "orderId": "",
        "saleChannel": "",
        "campaignId": 1754386284,
        "locationId": "",
        "txnSource": "SYSTEM",
        "description": "Points expired automatically by system",
        "type: "EXPIRED",
        "tnxId": "wl_wB3FNMnD0ea0QD0xwfg1W",
        "points": 259.9
      },
      {
        "txnTimestamp": 1754384850,
        "saleAmount": 1000,
        "metadata": {
          "Key1": "Test1",
          "key2": "Test2"
        },
        "orderId": "order123",
        "saleChannel": "UPI",
        "campaignId": 0,
        "locationId": "BAN123",
        "txnSource": "API",
        "description": "Reward points for purchase",
        "type": "CREDIT",
        "tnxId": "wl_71ezcyzGWLc0S19qeCUo1",
        "points": 77
      }
    ],
    "pagination": {
      "currentPage": 1,
      "pageSize": 25,
      "totalPages": 10,
      "totalRecords": 248,
      "hasNext": true
    },
    "promisedPoints": {
      "totalPromisedPoints": 0,
      "promisedPointsList": []
    },
    "pointsExpiring": {
      "earliestExpiryTimestamp": 1754471850,
      "pointsExpiringSoon": 77,
      "pointsExpiringList": [
        {
          "expiryTimestamp": 1754471850,
          "points": 77
        },
        {
          "expiryTimestamp": 1754472109,
          "points": 7.7
        }
      ]
    }
  }
}
📘

Note

  • The parameters type, txnSource, saleChannel, campaignId, orderId, and locationId in each allTransactions entry correspond directly to the optional query parameters you can use to filter results.
  • The from and to query parameters filter based on the txnTimestamp field.
  • The promisedPoints and pointsExpiring objects are not affected by any filters applied.

The sections below provide a detailed breakdown of the response payload for the Get Wallet Transactions API.

allTransactions Object

The allTransactionsobject returns the complete transaction history of the wallet, including credits, debits, expired, and pending transactions. Each transaction entry provides comprehensive details such as the transaction source, type, description, timestamp, and points involved.

Parameter

Description

Type

Sample Value

txnTimestamp

Unix timestamp (UTC epoch, in seconds) when the transaction was created.

Integer

1754386499

saleAmount

Total order amount associated with the transaction. For example, if a customer makes a purchase worth 2,499, this field reflects that value. Applies to both credit and debit transactions.

Numeric

2499

metadata

The key-value pairs to persist with the transactions. Applies to both credit and debit transactions.

Object

{ "cashierId": "C42", "campaign": "FESTIVE25" }

orderId

References the bill number to associate the transaction with a specific order ID for potential future refunds. This enables tracking transactions for return sales.

String

ORD12345

saleChannel

The source channel for the transaction (for example, Mobile, Web, POS). Applies to both credit and debit transactions created via API.

String

POS

locationId

Identifier for the transaction location (for example, store code). Applies to both credit and debit transactions created via API.

String

BAN123

txnSource

Source through which the wallet transaction occurred. The following are the possible sources:

  • Campaign: Transaction originated from a promotional campaign.
  • API: Transaction triggered via API integration.
  • Manual: Transaction added or updated manually by an administrator.
  • Cashback Coupon: A transaction that reflects cashback awarded to the user as part of a coupon redemption.
  • System: Transaction automatically generated by the system, for example, coupon expiration.

String

CAMPAIGN, API, MANUAL,CASHBACKCOUPON, SYSTEM

campaignId

The numeric ID of the CleverTap promo campaign associated with the transaction. For transactions not linked to a campaign, this field returns 0.

Integer

1754386284

description

Description of the wallet transaction.

String

Points debited for late payment

type

Wallet transaction type indicating the transaction's nature. The following are the possible values:

  • Credit: Points added to the wallet.
  • Debit: Points deducted from the wallet.
  • Expired: Points that have reached their expiry date and are no longer valid.
  • Pending: Points awaiting activation or clearance.

String

CREDIT, DEBIT, EXPIRED, PENDING

tnxId

Transaction ID assigned to a respective wallet transaction.

String

wl_MRCJSqtH9akcvzvK

points

Wallet points debited or credited against each transaction.

Numeric

20

📘

Note

For transactions created through the Debit/Credit API, the system keys, i.e., saleChannel, locationId, saleAmount and any metadata provided will be returned in the response. For expired or system-generated transactions, these keys may not apply and can appear as empty strings, i.e.,"", 0, or null. For example, refer to the Sample Response.

pagination Object

The pagination object is returned alongside the allTransactions array and provides details about the total volume of matching records and your current position within the paginated results. Use this object to build pagination controls in your platform's user interface. For example, displaying Page 2 of 10 or enabling a Next Page button.

ParameterDescriptionTypeSample Value
currentPageThe page number of the current response. Corresponds to the page query parameter passed in the request.Integer1
pageSizeThe number of records returned in the current page. The maximum is 25 records per page.Integer25
totalPagesThe total number of pages available for the current filter combination.Integer10
totalRecordsThe total number of transactions matching the applied filters across all pages.Integer248
hasNextIndicates whether there are more records available beyond the current page. true means additional pages exist. false means the current page is the last.Booleantrue
📘

Note

Pagination applies only to the allTransactions object. The promisedPoints and pointsExpiring objects always return up to 50 records each, unaffected by filters.

promisedPoints Object

The promisedPointsobject returns reward points that are yet to be credited to the wallet. It specifies the activation timestamp for promised points, a breakdown of individual entries, and the total promised points awaiting activation.

ParameterDescriptionTypeSample Value
promisedPointsListList of points yet to be credited to the user wallet.Array
activationTimestampUnix timestamp (UTC epoch, in seconds) on which the associated points will be credited or activated.Integer1754471850
pointsPoints that are pending and will be activated based on the activationTimestamp.Numeric30
totalPromisedPointsTotal points yet to be credited to the user wallet.Numeric100

pointsExpiring Object

The pointsExpiringobject returns details about reward points nearing expiry. It includes information such as the total points expiring soon, the nearest expiry date, and a detailed list of points with their respective expiry timestamps.

ParameterDescriptionTypeSample Value
pointsExpiringSoonTotal points expiring on the nearest upcoming expiry date.Numeric60
earliestExpiryTimestampUnix timestamp (UTC epoch, in seconds) of the nearest upcoming expiry date across all entries in pointsExpiringList.Integer1754471850
pointsExpiringListList of upcoming point expiry entries, each showing the expiry timestamp and the number of points expiring on that date. Sorted in ascending order by expiryTimestamp.Array of objects
pointsPoints expiring on the respective expiry date.Numeric20
expiryTimestampUnix timestamp (UTC epoch, in seconds) on which the respective points expire.Integer1754471850

Errors

To know the errors applicable to the Get Wallet Transactions API, refer to API Error Cases.


CleverTap Ask AI Widget (CSP-Safe)