Api DocumentationTransaction HistoryGet Transactions by UserId

Transaction History by User_Id API Documentation

This document explains how to retrieve the transaction history for a specific user, including support for pagination.

Overview

The transaction/history/user/:userId endpoint allows you to fetch a list of all transactions associated with a particular user. This is useful for providing transaction statements or history within your user-facing applications.

Retrieve User Transaction History

Description: Retrieves a paginated list of transaction history records for a specific user.

Path Parameters

ParameterTypeMandatoryDescription
userIdstringYesThe unique UUID of the user whose transaction history is being requested.

Query Parameters

ParameterTypeMandatoryDescription
pageintegerNoThe page number to retrieve (defaults to 1).
limitintegerNoThe number of records per page (defaults to 10).

cURL Command

curl --request GET \
  --url 'https://api.swiftramp.in/v1/transaction/history/user/[USER_ID]?page=1&limit=10' \
  --header 'Authorization: Bearer [ACCESS_TOKEN]' \
  --header 'Content-Type: application/json'

Success Response (200 OK)

{
    "status": true,
    "code": 200,
    "message": "Transactions fetched successfully",
    "data": {
        "total_transactions": 10,
        "page": 1,
        "limit": 10,
        "total_pages": 1,
        "transactions": [
            {
                "id": "019e5e8a-0d0c-71ea-8b92-34552bb084b1",
                "client_transaction_id": "87b2b208-a8e6-4185-90ba-67629a95eb49",
                "neokred_transaction_id": "87b2b208-a8e6-4185-90ba-67629a95eb50",
                "client_id": "ab937578-6553-4c46-8148-553869e1d88f",
                "user_id": "87b2b208-a8e6-4185-90ba-67629a95eb48",
                "account_holder_name": "Ravinder Joshi",
                "account_number": "987654321123",
                "ifsc_code": "SBIN0000031",
                "bank_name": "State Bank Of India",
                "amount": "100.00",
                "status": "PENDING",
                "currency": "INR",
                "utr": null,
                "remark": "remark",
                "metadata": null,
                "created_at": "2026-05-25T04:19:26.156Z",
                "updated_at": "2026-05-25T04:19:26.156Z"
            }
        ]
    }
}

Response Payload Details (Based on Model Schema)

Property NameTypeDescription
iduuidUnique identifier for the transaction record.
amountdecimal(12,2)The transaction amount.
statusenumCurrent state: PENDING, PROCESSING, SUCCESS, FAILED.
currencystring(3)Transaction currency (default: INR).
utrstring(100)Unique Transaction Reference number.
remarkstring(50)Optional transaction note.

Enums and Constants

Transaction Status

ValueDescription
PENDINGTransaction has been initiated and is awaiting final processing.
PROCESSINGTransaction is currently being handled by the banking network.
SUCCESSTransaction has been successfully completed.
FAILEDTransaction failed to complete.

  • πŸ’‘ Path Parameter: Ensure you replace [USER_ID] in the URL with the actual user’s UUID.
  • πŸ’‘ Schema Sync: All fields are synchronized with the TransactionHistory database model.
  • πŸ’‘ Authentication: Include a valid Bearer token in the Authorization header for all requests.