m2pfintech

Fetch FX Rates

Fetches the exchange rate between a source currency and destination currency. Use this to display rates to the customer before loading the forex card.

Rate Types

TypeDescription
IBRInterbank Rate
CARDCard rate (product-configured)
MIDMid-market rate

Response

Returns buyRate (rate at which platform buys foreign currency) and sellRate (rate at which platform sells to customer).

POST
/v1/forex/issuance/fetch-fx-rate

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

Header Parameters

X-TENANT-ID*string

Your unique tenant identifier

Request Body

application/json

business*string

Required. Business/tenant corporate ID

sourceCurrencyCode*string

Required. ISO numeric currency code of source

destinationCurrencyCode*string

Required. ISO numeric currency code of destination

exchangeRateType*string

Required. Rate type

Value in"IBR" | "CARD" | "MID" | "CRD"

Response Body

application/json

application/json

curl -X POST "https://sandbox-api.m2pprepaid.com/prepaid/middleware/v1/forex/issuance/fetch-fx-rate" \  -H "X-TENANT-ID: ACME_CORP" \  -H "Content-Type: application/json" \  -d '{    "business": "devfxinrks2dw9v95f",    "sourceCurrencyCode": "752",    "destinationCurrencyCode": "124",    "exchangeRateType": "CARD"  }'
{
  "result": {
    "sourceCurrency": "SEK",
    "destinationCurrency": "CAD",
    "sourceCurrencyCode": "752",
    "destinationCurrencyCode": "124",
    "sellRate": 48.62,
    "buyRate": 42.97,
    "type": "CARD"
  },
  "pagination": null
}

{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Failed to fetch conversation rate",
  "status": 409,
  "detail": "Failed to fetch conversation rate",
  "message": "error.business",
  "businessCode": "PP_CORP_117"
}