curl -X POST https://api.payonproof.com/api/compare-routes \
-H "Content-Type: application/json" \
-d '{
"origin": "US",
"destination": "PH",
"amount": 100
}'
POST /api/compare-routes
Compares available remittance routes from origin to destination country, returning scored routes with fee calculations and exchange rates.
This endpoint:
Filters anchors by country and operational status
Calculates fees (fixed + percentage)
Computes exchange rates
Scores routes based on cost, speed, and anchor reliability
Returns sorted routes (best first)
Request body
Origin country code (ISO 3166-1 alpha-2 format, e.g., “US”)
Destination country code (ISO 3166-1 alpha-2 format, e.g., “PH”)
Transfer amount in origin currency. Must be greater than 0.
Response
Array of available routes, sorted by score (best routes first) Origin anchor information Destination anchor information (same structure as originAnchor)
Origin currency code (e.g., “USD”)
Destination currency code (e.g., “PHP”)
Amount to send in origin currency
Amount recipient receives in destination currency
Exchange rate applied (destination/origin)
Total fees in origin currency (sum of origin and destination fees)
Fee charged by origin anchor
Fee charged by destination anchor (converted to origin currency)
Route quality score (0-100, higher is better)
Whether route is operational (both anchors support SEP-10 and SEP-24)
Response example
{
"routes" : [
{
"id" : "route_abc123" ,
"originAnchor" : {
"id" : "anchor_us_1" ,
"name" : "MoneyGram" ,
"domain" : "stellar.moneygram.com" ,
"country" : "US" ,
"currency" : "USD"
},
"destinationAnchor" : {
"id" : "anchor_ph_1" ,
"name" : "Philippines Anchor" ,
"domain" : "anchor.ph" ,
"country" : "PH" ,
"currency" : "PHP"
},
"originCurrency" : "USD" ,
"destinationCurrency" : "PHP" ,
"originAmount" : 100 ,
"destinationAmount" : 5450 ,
"exchangeRate" : 54.5 ,
"totalFees" : 2.5 ,
"originFee" : 1.5 ,
"destinationFee" : 1.0 ,
"score" : 92 ,
"available" : true
}
],
"summary" : {
"totalRoutes" : 4 ,
"availableRoutes" : 2 ,
"bestRate" : 54.5 ,
"lowestFee" : 2.5
}
}
Error responses
400 Bad Request
{
"error" : "Missing or invalid fields: origin, destination, amount"
}
405 Method Not Allowed
{
"error" : "Method not allowed"
}
500 Internal Server Error
{
"error" : "Database connection failed"
}
Implementation notes
Routes are scored based on multiple factors: total cost, exchange rate, anchor reliability
Only operational anchors (with valid SEP-10 and SEP-24 endpoints) are marked as available: true
Exchange rates are fetched from external FX services or calculated from anchor fees
Fees include both fixed amounts and percentage-based charges
Results are cached for performance