Skip to main content
Base URL: https://your-domain.com/api
All endpoints on this page require Authorization: Bearer {token}.

Flow overview

1

Get source wallets

Call GET /get-User-Wallets-WithActive-HasTransaction to list the user’s eligible source currencies.
2

Get destination wallets

Call POST /getWalletsExceptSelectedFromWallet to list available destination currencies.
3

Get exchange rate

Call POST /get-currencies-exchange-rate.
4

Review details

Call POST /review-exchange-details to calculate fees and final amounts.
5

Complete exchange

Call POST /exchange-money-complete.

GET /get-User-Wallets-WithActive-HasTransaction

Returns the user’s wallets that have active currencies with configured exchange fee/limit rules.

Request parameters

user_id
number
required
The authenticated user’s ID.

Response fields

success
object
curl --request GET \
  --url 'https://your-domain.com/api/get-User-Wallets-WithActive-HasTransaction?user_id=42' \
  --header 'Authorization: Bearer {token}'

POST /exchange-review

Validates the source amount against balance and fee/limit rules before proceeding.

Request parameters

user_id
number
required
The authenticated user’s ID.
currency_id
number
required
Source wallet currency ID.
amount
number
required
Amount to exchange.

Response fields

success
object
curl --request POST \
  --url https://your-domain.com/api/exchange-review \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{"user_id": 42, "currency_id": 1, "amount": 100}'

POST /getBalanceOfFromAndToWallet

Returns the balance and currency code for a specific wallet.

Request parameters

user_id
number
required
The authenticated user’s ID.
currency_id
number
required
The wallet’s currency ID.

Response fields

status
boolean
true if the wallet exists.
balance
string
Numeric balance formatted to 2 decimal places.
currencyCode
string
Currency code.
curl --request POST \
  --url https://your-domain.com/api/getBalanceOfFromAndToWallet \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{"user_id": 42, "currency_id": 1}'

POST /getWalletsExceptSelectedFromWallet

Returns available destination currencies, excluding the selected source currency.

Request parameters

user_id
number
required
The authenticated user’s ID.
currency_id
number
required
The source currency ID to exclude.

Response fields

status
boolean
true if currencies are available.
currencies
object
Key-value map of currency_id to {id, code, balance}. null if no eligible currencies.
curl --request POST \
  --url https://your-domain.com/api/getWalletsExceptSelectedFromWallet \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{"user_id": 42, "currency_id": 1}'

POST /get-currencies-exchange-rate

Returns the current exchange rate from one currency to another.

Request parameters

fromWallet
number
required
Source currency ID.
fromWalletCode
string
required
Source currency code (e.g. USD). Used for API rate lookup.
toWallet
number
required
Destination currency ID.
amount
number
required
Amount to convert (used for display calculation only).

Response fields

success
object
curl --request POST \
  --url https://your-domain.com/api/get-currencies-exchange-rate \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "fromWallet": 1,
    "fromWalletCode": "USD",
    "toWallet": 2,
    "amount": 100
  }'

POST /review-exchange-details

Calculates fees and the final converted amount for the exchange.

Request parameters

user_id
number
required
The authenticated user’s ID.
amount
number
required
Source amount.
fromWalletValue
number
required
Source currency ID.
toWalletRate
number
required
Exchange rate from /get-currencies-exchange-rate.

Response fields

success
object
curl --request POST \
  --url https://your-domain.com/api/review-exchange-details \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "user_id": 42,
    "amount": 100,
    "fromWalletValue": 1,
    "toWalletRate": 0.85
  }'

POST /exchange-money-complete

Executes the currency exchange. Deducts from the source wallet and credits the destination wallet.

Request parameters

user_id
number
required
The authenticated user’s ID.
fromWalletValue
number
required
Source currency ID.
toWalletValue
number
required
Destination currency ID.
fromWalletAmount
number
required
Source amount to deduct.
toWalletAmount
number
required
Converted amount to credit in destination currency.
toWalletExchangeRate
number
required
Exchange rate used.
totalFees
number
required
Total fees from /review-exchange-details.

Response fields

status
boolean
true on success, false on hard failure.
exchangeMoneyValidationErrorMessage
string
Error message when status is false.
curl --request POST \
  --url https://your-domain.com/api/exchange-money-complete \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "user_id": 42,
    "fromWalletValue": 1,
    "toWalletValue": 2,
    "fromWalletAmount": 100,
    "toWalletAmount": 85,
    "toWalletExchangeRate": 0.85,
    "totalFees": 1.50
  }'

Build docs developers (and LLMs) love