Skip to main content

Transaction Statistics API

Overview

Retrieve day-wise transaction statistics for a specific user and product code within a given date range. This API provides aggregated transaction data including daily transaction counts and amounts for analytics and reporting purposes.

API Details

Endpoint

POST https://api.gafapay.com:8443/gafapay/v3/analytics/transaction_statistics

Request Body

{
"user_id": "9034ba0b63494ce59233655013925b6f",
"product_code": "P2P",
"start_date": 1757199600,
"end_date": 1757819599
}

Request Parameters

ParameterTypeRequiredDescription
user_idStringYesUser ID for which statistics are needed
product_codeStringYesProduct code to filter transactions (e.g., "P2P", "CIB", "COB", "MS", "AS", "CS")
start_dateLongYesStart date in epoch seconds
end_dateLongYesEnd date in epoch seconds
timezone_idStringNoTimezone ID for date formatting (default: "UTC")

Headers

companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: b35d332f-131e-44c1-892f-8322e022da74
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4MzU2MjM4fQ.u8gjlrl72lsif6oWqQV8mlGUaziy0TlvNPzmPZrEzcQ
Content-Type: application/json

Response

{
"success": 1,
"error": [],
"data": {
"day_statistics": [
{
"day_start_time": 1757199600,
"day_end_time": 1757285999,
"total_amount": 0.0,
"total_txn_count": 0,
"date": "2025-09-06"
},
{
"day_start_time": 1757286000,
"day_end_time": 1757372399,
"total_amount": 0.0,
"total_txn_count": 0,
"date": "2025-09-07"
},
{
"day_start_time": 1757372400,
"day_end_time": 1757458799,
"total_amount": 0.0,
"total_txn_count": 0,
"date": "2025-09-08"
},
{
"day_start_time": 1757458800,
"day_end_time": 1757545199,
"total_amount": 0.0,
"total_txn_count": 0,
"date": "2025-09-09"
},
{
"day_start_time": 1757545200,
"day_end_time": 1757631599,
"total_amount": 0.0,
"total_txn_count": 0,
"date": "2025-09-10"
},
{
"day_start_time": 1757631600,
"day_end_time": 1757717999,
"total_amount": 0.0,
"total_txn_count": 0,
"date": "2025-09-11"
},
{
"day_start_time": 1757718000,
"day_end_time": 1757804399,
"total_amount": 980.0,
"total_txn_count": 4,
"date": "2025-09-12"
},
{
"day_start_time": 1757804400,
"day_end_time": 1757890799,
"total_amount": 7687.0,
"total_txn_count": 2,
"date": "2025-09-13"
}
],
"user_id": "9034ba0b63494ce59233655013925b6f",
"product_code": "P2P",
"timezone_id": "UTC",
"start_date": 1757199600,
"end_date": 1757819599
}
}

Response Fields

  • success (integer): Response status indicator
    • 1 = Success
    • 0 = Failure
  • error (array): Array of error messages (empty on success)
  • data (object): Response data object
    • day_statistics (array): Array of daily statistics objects
    • user_id (string): User ID for which statistics were retrieved
    • product_code (string): Product code used for filtering
    • timezone_id (string): Timezone used for date formatting
    • start_date (long): Start date in epoch seconds
    • end_date (long): End date in epoch seconds

Day Statistics Object Fields

Each object in the day_statistics array contains:

FieldTypeDescription
day_start_timeLongStart time of the day in epoch seconds
day_end_timeLongEnd time of the day in epoch seconds
total_amountDoubleTotal transaction amount for the day
total_txn_countIntegerTotal number of transactions for the day
dateStringDate in YYYY-MM-DD format for display

Timezone Support

The API supports various timezone identifiers for date formatting:

  • UTC (default)
  • America/New_York
  • Europe/London
  • Asia/Kolkata
  • Africa/Dakar
  • And other standard timezone identifiers

Example Usage

Basic Request

curl --location 'https://api.gafapay.com:8443/gafapay/v3/analytics/transaction_statistics' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4MzU2MjM4fQ.u8gjlrl72lsif6oWqQV8mlGUaziy0TlvNPzmPZrEzcQ' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: b35d332f-131e-44c1-892f-8322e022da74' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "9034ba0b63494ce59233655013925b6f",
"product_code": "P2P",
"start_date": 1757199600,
"end_date": 1757819599
}'

Request with Custom Timezone

curl --location 'https://api.gafapay.com:8443/gafapay/v3/analytics/transaction_statistics' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "9034ba0b63494ce59233655013925b6f",
"product_code": "CIB",
"start_date": 1757199600,
"end_date": 1757819599,
"timezone_id": "Asia/Kolkata"
}'

Request for Different Product Code

curl --location 'https://api.gafapay.com:8443/gafapay/v3/analytics/transaction_statistics' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "9034ba0b63494ce59233655013925b6f",
"product_code": "COB",
"start_date": 1757199600,
"end_date": 1757819599
}'

Notes

  • This API returns day-wise statistics for transactions where the specified user_id is either debit or credit user
  • The API generates statistics for all days in the specified date range, including days with zero transactions
  • Results are sorted chronologically by date
  • Date parameters use Unix timestamps (epoch seconds)
  • The API filters transactions based on the specified product_code
  • Timezone parameter affects only the date formatting in the response, not the actual data filtering
  • Transaction amounts and counts are aggregated for each day
  • The API supports various product codes for different transaction types
  • Days with no transactions will show total_amount: 0.0 and total_txn_count: 0