Skip to main content

Routes

A route describes one corridor your company is configured to send through β€” the payout type it uses, the rate quoted for it, its fee schedule, and the limits currently in force. RoutesClient exposes a single read endpoint that lists what is available today.

Reach it either directly on RetornaClient or through client.routes() β€” both call the same code.

getRoutes() / getRoutes(sourceCurrency)​

Lists the routes configured for the authenticated company.

Signature​

public RoutesResponse getRoutes()

public RoutesResponse getRoutes(String sourceCurrency)

The no-argument overload is equivalent to calling the other with sourceCurrency = null, which falls back to the backend default source currency, USDR.

Parameters​

NameTypeRequiredDescription
sourceCurrencyStringNoCurrency the routes are quoted from. Null falls back to the backend default (USDR).

Returns​

RoutesResponse:

AccessorTypeMeaning
routes()List<Route>Configured routes. Wire field is routes, not data.

Each Route:

AccessorTypeMeaning
name()StringRoute display name.
method()StringPayout method for this route (e.g. "BANK_TRANSFER"). Kept as a string so a new method does not break deserialization.
country()StringDestination country, ISO 3166-1 alpha-2.
currency()StringDestination currency.
rate()StringQuoted exchange rate for the route, as a decimal string (e.g. "852.79") β€” same as every other amount on the wire. It is indicative, from the corridor configuration, not a settled money amount.
fees()List<RouteFee>Fee schedule; empty when none apply. Each RouteFee has pricingRule(), pricingType(), percentageValue() (double), flatValue() (double), pricingLabel() β€” all camelCase on the wire too, unlike the rest of this envelope.
limits()RouteLimitsSee below.

RouteLimits:

AccessorTypeMeaning
perTransaction()PerTransactionLimitmin()/max(), decimal strings, per-transaction bounds.
transaction()TransactionWindowsCount-based windows: daily(), weekly(), monthly(), each a TransactionWindow with max(), current(), remaining() (all int).
fund()FundWindowsValue-based windows: daily(), weekly(), monthly(), each a FundWindow with max(), current(), remaining() (all decimal strings).

Example​

import app.retorna.sdk.RetornaClient;
import app.retorna.sdk.RetornaClientBuilder;
import app.retorna.sdk.core.environment.RetornaEnvironment;
import app.retorna.sdk.models.route.Route;
import app.retorna.sdk.models.route.RoutesResponse;

RetornaClient client = new RetornaClientBuilder()
.environment(RetornaEnvironment.SANDBOX)
.clientId(System.getenv("RETORNA_CLIENT_ID"))
.clientSecret(System.getenv("RETORNA_CLIENT_SECRET"))
.privateKey(System.getenv("RETORNA_PRIVATE_KEY"))
.buildClient();

RoutesResponse routes = client.getRoutes("USDR");
for (Route route : routes.routes()) {
System.out.printf("%s -> %s %s (%s) rate=%s max/txn=%s%n",
route.name(), route.country(), route.currency(), route.method(),
route.rate(), route.limits().perTransaction().max());
}

Errors​

  • IllegalArgumentException β€” a non-null but empty sourceCurrency.
  • RetornaB2BException with codeEnum() one of: B2B_UNAUTHORIZED, B2B_COMPANY_NOT_FOUND β€” no company associated with the credentials, B2B_RATE_LIMITED β€” retryable, B2B_UNKNOWN.
  • RetornaAuthException β€” token exchange failure.
  • RetornaSdkException β€” network failure or deserialization failure.

Notes​

  • Limits move as the period is consumed β€” read them at call time and do not cache them as a fixed table.
  • rate() on a route is informational for planning a corridor; get the actual locked-in rate for a specific transfer from createQuotation.

API reference​

GET /me/routes