Skip to main content
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
string
required
Origin country code (ISO 3166-1 alpha-2 format, e.g., “US”)
destination
string
required
Destination country code (ISO 3166-1 alpha-2 format, e.g., “PH”)
amount
number
required
Transfer amount in origin currency. Must be greater than 0.

Response

routes
array
Array of available routes, sorted by score (best routes first)
summary
object
totalRoutes
number
Total routes found
availableRoutes
number
Operational routes
bestRate
number
Best exchange rate found
lowestFee
number
Lowest total fee found

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

error
string
Error message
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

Build docs developers (and LLMs) love