Overview
Retrieves detailed card transaction history with support for pagination and multiple filtering options. Returns comprehensive transaction information including merchant details, amounts, fees, currency conversions, and funding source breakdown.
Real-Time Data Transactions appear in this endpoint within seconds of authorization. Pending transactions are included alongside confirmed ones with appropriate status indicators.
Authentication
This endpoint requires authentication via Bearer token:
Authorization: Bearer YOUR_ACCESS_TOKEN
Request
Your public API client key
Set to true to route requests to the US backend environment
Bearer token for authentication
Query Parameters
Start date for filtering transactions in ISO 8601 format (YYYY-MM-DD) Required: Only if dateTo is providedExample: 2024-10-24
End date for filtering transactions in ISO 8601 format (YYYY-MM-DD) Required: Only if dateFrom is providedExample: 2024-10-25Note: Both dateFrom and dateTo must be provided together
Search term to filter transactions by merchant name or location Example: PayPal, Starbucks, AmazonBehavior: Case-insensitive partial matching
Comma-separated list of merchant category codes (MCC) to filter transactions Accepted Values:
SUBSCRIPTIONS - Recurring subscription services
FOOD - Restaurants, grocery stores, food delivery
TRAVEL - Airlines, hotels, car rentals, transportation
ENTERTAINMENT - Movies, concerts, streaming services
HEALTH - Pharmacies, medical services, fitness
ATM - ATM withdrawals and fees
UTILITIES - Bills, utilities, telecommunications
MISC - Miscellaneous purchases
Example: FOOD,ENTERTAINMENT or SUBSCRIPTIONS
Page number for pagination (0-indexed) Example: 0, 1, 5Note: If page doesn’t exist, returns page 0
Request Examples
All Transactions
Date Range Filter
Search by Merchant
Category Filter
Combined Filters with Pagination
JavaScript
Python
TypeScript
curl -X GET "https://dev.api.baanx.com/v1/card/transactions" \
-H "x-client-key: YOUR_CLIENT_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
Success Response
Returns an array of transaction objects, ordered by most recent first.
Unique transaction identifier (UUID)
Last 4 digits of the card used
External transaction ID from payment processor
Transaction timestamp in ISO 8601 format
Transaction direction Values:
DEBIT - Money leaving the card (purchase, withdrawal)
CREDIT - Money entering the card (refund, reversal)
Merchant name and location information
Type of merchant or transaction context Example: OutOfWalletOnline, InStore, ATM
Merchant Category Code (4-digit industry code)
Human-readable category derived from MCC Values: SUBSCRIPTIONS, FOOD, TRAVEL, ENTERTAINMENT, HEALTH, ATM, UTILITIES, MISC
Currency used for the card transaction (typically card’s base currency) Example: EUR, USD, GBP
amountInTransactionCurrency
Transaction amount in the card’s currency
feesInTransactionCurrency
Fees charged in the card’s currency
Currency used at the merchant (may differ from card currency) Example: USD, EUR, GBP
Transaction amount in the merchant’s original currency
Fees in the merchant’s original currency
Conversion rate used for billing between original and transaction currency
European Central Bank reference exchange rate at transaction time
Current transaction status Values:
CONFIRMED - Transaction completed successfully
PENDING - Transaction authorized but not yet settled
DECLINED - Transaction authorization failed
REVERTED - Transaction was reversed/refunded
Explanation for declined transactions (only present when status=DECLINED)
Array of funding sources used to pay for this transaction Show Funding Source Object
Unique funding source identifier
Wallet or account address used for funding
Blockchain network used Values: linea, solana, ethereum
Blockchain transaction hash (for crypto funding sources)
Cryptocurrency or token used Example: usdc, usdt
Amount deducted from this funding source
Currency swap fee (if applicable)
Direction for this funding source Values: DEBIT, CREDIT
Status of this funding transaction Values: CONFIRMED, PENDING, DECLINED
Timestamp of the funding transaction
[
{
"id" : "100a99cf-f4d3-4fa1-9be9-2e9828b20ebb" ,
"cardId" : "1234537292209260487" ,
"panLast4" : "9189" ,
"transactionId" : "1122334477422" ,
"dateTime" : "2024-10-14T10:44:36.276Z" ,
"sign" : "DEBIT" ,
"merchantNameLocation" : "WWW.ALIEXPRESS.COM, LONDON" ,
"merchantType" : "OutOfWalletOnline" ,
"mcc" : 5964 ,
"mccCategory" : "MISC" ,
"transactionCurrency" : "EUR" ,
"amountInTransactionCurrency" : "0.79" ,
"feesInTransactionCurrency" : "0" ,
"originalCurrency" : "USD" ,
"amountInOriginalCurrency" : "0.85" ,
"feesInOriginalCurrency" : "0" ,
"billingConversionRate" : "0.9294117647058824" ,
"ecbRate" : "0.9161704076958315" ,
"status" : "CONFIRMED" ,
"declineReason" : "" ,
"fundingSources" : [
{
"id" : "3181a37a-07fa-41dc-b423-6c2db07a7ba1" ,
"address" : "0x3a11a86cf218c448be519728cd3ac5c741fb3424" ,
"network" : "linea" ,
"txHash" : "0xb92de09d893e8162b0861c0f7321f68df02212efbc58f208839ae3f176d89638" ,
"currency" : "usdc" ,
"amount" : "0.104201" ,
"fees" : "0" ,
"swapFee" : "0.00208" ,
"sign" : "DEBIT" ,
"status" : "CONFIRMED" ,
"dateTime" : "2024-10-14T10:44:36.288Z"
}
]
}
]
Error Responses
401 - Unauthorized
403 - Forbidden
498 - Invalid Client Key
499 - Missing Client Key
500 - Internal Server Error
{
"message" : "Not authenticated"
}
Transactions are returned in pages. The default page size is determined by the backend configuration (typically 20-50 transactions per page).
async function getAllTransactionsForMonth ( year : number , month : number ) {
const transactions : Transaction [] = [];
let page = 0 ;
let hasMore = true ;
const dateFrom = ` ${ year } - ${ String ( month ). padStart ( 2 , '0' ) } -01` ;
const dateTo = new Date ( year , month , 0 ). toISOString (). split ( 'T' )[ 0 ];
while ( hasMore ) {
const pageData = await getTransactions ({
dateFrom ,
dateTo ,
page
});
transactions . push ( ... pageData );
hasMore = pageData . length > 0 ;
page ++ ;
}
return transactions ;
}
Common Use Cases
Recent Transactions
async function getRecentTransactions ( days : number = 7 ) {
const dateTo = new Date (). toISOString (). split ( 'T' )[ 0 ];
const dateFrom = new Date ( Date . now () - days * 24 * 60 * 60 * 1000 )
. toISOString ()
. split ( 'T' )[ 0 ];
return await getTransactions ({ dateFrom , dateTo });
}
Spending by Category
async function getSpendingByCategory ( category : string ) {
const transactions = await getTransactions ({
mccCategories: category
});
const total = transactions . reduce (( sum , tx ) => {
if ( tx . sign === 'DEBIT' && tx . status === 'CONFIRMED' ) {
return sum + parseFloat ( tx . amountInTransactionCurrency );
}
return sum ;
}, 0 );
return { category , total , count: transactions . length };
}
Transaction Search
async function searchTransactions ( query : string ) {
return await getTransactions ({
searchKey: query
});
}
Monthly Statement Data
async function getMonthlyStatement ( year : number , month : number ) {
const dateFrom = ` ${ year } - ${ String ( month ). padStart ( 2 , '0' ) } -01` ;
const lastDay = new Date ( year , month , 0 ). getDate ();
const dateTo = ` ${ year } - ${ String ( month ). padStart ( 2 , '0' ) } - ${ lastDay } ` ;
const transactions = await getTransactions ({ dateFrom , dateTo });
const summary = {
totalSpent: 0 ,
totalRefunds: 0 ,
transactionCount: transactions . length ,
byCategory: {} as Record < string , number >
};
transactions . forEach ( tx => {
if ( tx . status === 'CONFIRMED' ) {
const amount = parseFloat ( tx . amountInTransactionCurrency );
if ( tx . sign === 'DEBIT' ) {
summary . totalSpent += amount ;
} else if ( tx . sign === 'CREDIT' ) {
summary . totalRefunds += amount ;
}
if ( ! summary . byCategory [ tx . mccCategory ]) {
summary . byCategory [ tx . mccCategory ] = 0 ;
}
summary . byCategory [ tx . mccCategory ] += amount ;
}
});
return summary ;
}
Transaction Status Explained
Meaning: Transaction completed successfully and has been settledActions: Funds have been deducted/added, blockchain transactions confirmedDisplay: Show as final transaction in transaction history
Meaning: Transaction authorized but not yet settledActions: Funds are held/reserved but not yet transferredDisplay: Show with pending indicator, may take 1-3 business days to confirmNote: Pending transactions can still be reversed
Meaning: Transaction authorization failedActions: No funds were transferredCommon Reasons:
Insufficient balance
Card frozen or blocked
Security concerns
Merchant restrictions
Network issues
Display: Show with declined indicator and reason if available
Meaning: Previously confirmed transaction was reversed/refundedActions: Funds returned to original funding sourceCommon Causes:
Merchant refund
Dispute resolution
Chargeback
Transaction cancellation
Display: Show as refund/reversal in transaction history
Edge Cases and Important Notes
Date Range Validation Both dateFrom and dateTo must be provided together. Providing only one will result in both being ignored.
Pagination Behavior If you request a page that doesn’t exist (e.g., page 100 when only 10 pages exist), the API returns page 0 instead of an error.
Currency Conversion Transactions show both the original merchant currency and the card’s transaction currency, along with the conversion rate used. This transparency helps users understand exchange rate costs.
Funding Sources Each transaction may have multiple funding sources. The sum of all funding source amounts equals the total transaction amount plus fees.
GET /v1/card/transactions/statement - Generate downloadable transaction statement (CSV/PDF)
GET /v1/card/status - Get card information
POST /v1/card/freeze - Freeze card to prevent future transactions