m2pfintech
API LibraryTransaction

Fetch All Forex Transactions

Retrieves transaction history specifically for forex cards. The response includes a parent-child transaction structure where:

  • Parent transaction: The original card-level transaction (e.g., POS purchase in SGD)
  • Child transactions: Wallet-level breakdowns showing which currency wallets were debited and the exchange rates applied

When to Use

  • Display forex transaction history with currency conversion details
  • Show customers how multi-currency transactions were split across wallets
  • Reconciliation for forex card operations

Response Fields

Key fields in each transaction:

  • transactionCurrencyCode / transactionCurrencyCodeName: Currency of the original transaction
  • baseCurrencyCode / baseCurrencyCodeName: Base currency (typically USD)
  • exchangeRate, markupRate, markupServiceTax: Currency conversion details
  • preBalance / postBalance: Wallet balance before/after (in child transactions)
  • forexWallet: Which forex wallet was used
POST
/v1/transactions/fetch/forexAll

Authorization

bearerAuth tenantId
AuthorizationBearer <token>

JWT Bearer token from the Authentication API

In: header

X-TENANT-ID<token>

Your unique tenant identifier assigned during onboarding

In: header

Query Parameters

pageNo?integer

Page number (0-indexed)

Default0
pageSize?integer

Number of records per page

Default10

Header Parameters

X-TENANT-ID*string

Your unique tenant identifier

Request Body

application/json

entityId*string

Required. Cardholder's entity identifier

Length1 <= length
mobile?

Filter by mobile number (optional)

kit?string

Filter by card kit number (optional)

fromDate?string

Start date (inclusive). Format: dd-mm-yyyy

toDate?string

End date (inclusive). Format: dd-mm-yyyy

accountId?string

Filter by specific wallet/account ID (optional)

success?boolean

Set to true to return only successful transactions

isOffline?boolean

Set to true to include offline transactions

dataMart?boolean

Response Body

application/json

application/json

application/json

curl -X POST "https://sandbox-api.m2pprepaid.com/prepaid/customer/v1/transactions/fetch/forexAll" \  -H "X-TENANT-ID: ACME_CORP" \  -H "Content-Type: application/json" \  -d '{    "entityId": "476843769320000541160925",    "fromDate": "01-10-2025",    "toDate": "31-10-2025"  }'
{
  "result": [
    {
      "parentTxn": {
        "amount": "-20.0",
        "transactionAmount": "20.00",
        "transactionStatus": "SUCCESS",
        "transactionType": "ECOM",
        "txnOrigin": "ECOM",
        "time": "2025-10-22T15:55:28.905Z",
        "merchantName": "Amazon US",
        "merchantLocation": "Seattle US",
        "merchantId": "AMZ001",
        "mcc": "5411",
        "externalTransactionId": "020044426174700800188ECOM01_337786787811",
        "retrievalReferenceNo": "337786787811",
        "kitNo": "320000541",
        "transactionCurrencyCode": "840",
        "transactionCurrencyCodeName": "USD",
        "baseCurrencyCode": "840",
        "baseCurrencyCodeName": "USD",
        "baseConvertedAmount": "20.0",
        "networkType": "VISA",
        "crDr": "D"
      },
      "childTxnCount": 1,
      "childTxns": [
        {
          "amount": "-20.0",
          "preBalance": "1457.44",
          "postBalance": "1437.44",
          "transactionStatus": "SUCCESS",
          "transactionType": "ECOM",
          "exchangeRate": 1,
          "markupRate": 0,
          "markupServiceTax": 0,
          "transactionCurrencyCode": "840",
          "transactionCurrencyCodeName": "USD",
          "forexWallet": {
            "walletName": "USD",
            "walletType": "USD",
            "walletCurrencyCodeName": "USD"
          }
        }
      ]
    }
  ],
  "pagination": {
    "list": true,
    "pageSize": 10,
    "pageNo": 0,
    "totalPages": 1,
    "totalElements": 1
  }
}
{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Bad Request",
  "status": 400,
  "detail": "Unable to convert http message",
  "message": "error.http.400"
}

{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Customer does not exist",
  "status": 409,
  "detail": "Customer does not exists for id",
  "message": "error.business",
  "businessCode": "PPCUST_002"
}