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β
| Name | Type | Required | Description |
|---|---|---|---|
params.sourceCurrency | string | No | Source currency filter. The server defaults to "USDR" when omitted. |
Returnsβ
RoutesResponse:
| Field | Type | Meaning |
|---|---|---|
routes | Route[] | The available routes. |
routes[].name | string | Route name. |
routes[].method | string | Payout method, e.g. "BANK_TRANSFER". |
routes[].country | string | 2-character destination country. |
routes[].currency | string | Destination currency for the route, e.g. "VES". |
routes[].rate | string | Exchange rate quoted for the route, as a decimal string (e.g. "852.79"). |
routes[].fees[].pricingRule | string | Fee rule identifier. camelCase β the one part of this response that stays camelCase. |
routes[].fees[].pricingType | string | e.g. "FEE". |
routes[].fees[].percentageValue | number | Percentage component of the fee. |
routes[].fees[].flatValue | number | Flat component of the fee. |
routes[].fees[].pricingLabel | string | Human-readable label for the fee line. |
routes[].limits.per_transaction.min / .max | string | Per-transaction limits, decimal strings. |
routes[].limits.transaction.daily/weekly/monthly.max | number | Transaction-count limit for the window. |
routes[].limits.transaction.daily/weekly/monthly.current | number | Transactions already consumed in the window. |
routes[].limits.transaction.daily/weekly/monthly.remaining | number | max - current. |
routes[].limits.fund.daily/weekly/monthly.max | string | Funded-amount limit for the window, decimal string. |
routes[].limits.fund.daily/weekly/monthly.current | string | Amount already funded in the window, decimal string. |
routes[].limits.fund.daily/weekly/monthly.remaining | string | max - 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 withcorrelationId.
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.
sourceCurrencyis the only parameter β there is no per-corridor filter beyond what the routes list already returns.