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β
| Name | Type | Required | Description |
|---|---|---|---|
sourceCurrency | String | No | Currency the routes are quoted from. Null falls back to the backend default (USDR). |
Returnsβ
RoutesResponse:
| Accessor | Type | Meaning |
|---|---|---|
routes() | List<Route> | Configured routes. Wire field is routes, not data. |
Each Route:
| Accessor | Type | Meaning |
|---|---|---|
name() | String | Route display name. |
method() | String | Payout method for this route (e.g. "BANK_TRANSFER"). Kept as a string so a new method does not break deserialization. |
country() | String | Destination country, ISO 3166-1 alpha-2. |
currency() | String | Destination currency. |
rate() | String | Quoted 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() | RouteLimits | See below. |
RouteLimits:
| Accessor | Type | Meaning |
|---|---|---|
perTransaction() | PerTransactionLimit | min()/max(), decimal strings, per-transaction bounds. |
transaction() | TransactionWindows | Count-based windows: daily(), weekly(), monthly(), each a TransactionWindow with max(), current(), remaining() (all int). |
fund() | FundWindows | Value-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 emptysourceCurrency.RetornaB2BExceptionwithcodeEnum()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 fromcreateQuotation.