Skip to main content

Routes

A Route describes one destination corridor your company can send to right now β€” the payout method, country, currency, quoted rate, fee schedule, and the operational limits currently available. getRoutes is the one method on this object: read it at runtime instead of hardcoding corridors or limits, since both move with your consumption.

getRoutes(...)​

Lists the routes currently available to your company for a given source currency.

Signature​

getRoutes(params?: GetRoutesParams): Promise<RoutesResponse>

Parameters​

NameTypeRequiredDescription
params.sourceCurrencystringNoSource currency filter. The server defaults to "USDR" when omitted.

Returns​

RoutesResponse:

FieldTypeMeaning
routesRoute[]The available routes.
routes[].namestringRoute name.
routes[].methodstringPayout method, e.g. "BANK_TRANSFER".
routes[].countrystring2-character destination country.
routes[].currencystringDestination currency for the route, e.g. "VES".
routes[].ratestringExchange rate quoted for the route, as a decimal string (e.g. "852.79").
routes[].fees[].pricingRulestringFee rule identifier. camelCase β€” the one part of this response that stays camelCase.
routes[].fees[].pricingTypestringe.g. "FEE".
routes[].fees[].percentageValuenumberPercentage component of the fee.
routes[].fees[].flatValuenumberFlat component of the fee.
routes[].fees[].pricingLabelstringHuman-readable label for the fee line.
routes[].limits.per_transaction.min / .maxstringPer-transaction limits, decimal strings.
routes[].limits.transaction.daily/weekly/monthly.maxnumberTransaction-count limit for the window.
routes[].limits.transaction.daily/weekly/monthly.currentnumberTransactions already consumed in the window.
routes[].limits.transaction.daily/weekly/monthly.remainingnumbermax - current.
routes[].limits.fund.daily/weekly/monthly.maxstringFunded-amount limit for the window, decimal string.
routes[].limits.fund.daily/weekly/monthly.currentstringAmount already funded in the window, decimal string.
routes[].limits.fund.daily/weekly/monthly.remainingstringmax - current, decimal string.

Example​

import {
RetornaClientBuilder,
RetornaEnvironment,
} from "@retorna-tech/retorna-gateway-sdk";

const client = new RetornaClientBuilder()
.environment(RetornaEnvironment.SANDBOX)
.clientId(process.env.RETORNA_CLIENT_ID!)
.clientSecret(process.env.RETORNA_CLIENT_SECRET!)
.privateKey(process.env.RETORNA_PRIVATE_KEY!)
.buildClient();

const { routes } = await client.getRoutes({ sourceCurrency: "USDR" });

for (const route of routes) {
console.log(route.method, route.country, route.currency, route.rate);
console.log(route.limits.per_transaction.min, route.limits.per_transaction.max);
}

Errors​

From the API (RetornaB2BError, see the error catalog):

  • B2B_UNAUTHORIZED β€” credentials, token, or signature rejected.
  • B2B_COMPANY_NOT_FOUND β€” no company is associated with the credentials used.
  • B2B_RATE_LIMITED β€” too many requests; retry with backoff.
  • B2B_UNKNOWN β€” unclassified failure; retry once, then escalate with correlationId.

Notes​

  • fees[] is the one part of the response that stays camelCase β€” everything else in this contract is snake_case.
  • Every route's USDR limits move with your consumption; read them at call time instead of caching them.
  • sourceCurrency is the only parameter β€” there is no per-corridor filter beyond what the routes list already returns.

API reference​

GET /me/routes