Skip to main content
GET
/
api
/
v1
/
transfers
/
crypto
/
calculate-fee
Calculate Crypto Transfer Fee
curl --request GET \
  --url https://api-production.fossapay.com/api/v1/transfers/crypto/calculate-fee
{
  "status": true,
  "statusCode": 200,
  "message": "Transfer fee calculated successfully",
  "data": {
    "amount": 200,
    "currency": "usdc",
    "feeAmount": 1,
    "total": 201
  }
}

Query Parameters

amount
number
required
The transfer amount for which to calculate the fee. Must be a positive number (minimum 0.01).
currency
string
required
The stablecoin to calculate fees for. Must be one of: usdc, usdt (case-insensitive; values are normalized to lowercase).

Request Example

curl -g 'https://api-production.fossapay.com/api/v1/transfers/crypto/calculate-fee?amount=200&currency=usdc' \
  -H "x-api-key: your_api_key_here"
const params = new URLSearchParams({
  amount: '200',
  currency: 'usdc',
});
const response = await fetch(
  `https://api-production.fossapay.com/api/v1/transfers/crypto/calculate-fee?${params}`,
  {
    method: 'GET',
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status} ${response.statusText}`);
}

const feeData = await response.json();
This endpoint uses GET with query parameters, not a JSON body. When using curl in a shell, wrap the full URL in quotes (or use curl -g) so & between query parameters is not treated as a background operator.

Response

{
  "status": true,
  "statusCode": 200,
  "message": "Transfer fee calculated successfully",
  "data": {
    "amount": 200,
    "currency": "usdc",
    "feeAmount": 1,
    "total": 201
  }
}
FieldDescription
data.amountThe amount you passed in the query
data.currencyThe stablecoin (usdc or usdt)
data.feeAmountThe fee charged for the crypto payout
data.totalamount + feeAmount (total including fee)

Validation errors

HTTP statusTypical cause
422Missing or invalid query params (e.g. amount not a positive number, currency empty or not usdc/usdt)
400amount or currency missing after validation, or unsupported currency at the service layer