How one payment is routed in Decide mode
In Decide mode, the default for regulated platforms, Unirail makes the decision and your backend makes every provider call. Scroll to follow a £50.00 payment between two UK accounts from the first request to the outcome your backend reports back.
Skip the walkthrough-
Your backend requests a route decision
Before it moves money, links a bank or checks an identity, your backend sends Unirail a route decision request. This one is a £50.00 payment from a UK sort code and account number to a UK IBAN, asking for the recommended rail.
POST /v1/route_decisionsExample
- operation
- banking.pis.single
- amount
- "5000" iso4217:GBP
- payer
- GB · scan · fp_9xQ2…
- payee
- GB · iban
- preference
- recommended
-
What the request contains
Names, account numbers and contact details stay on your platform. Each account goes as a fingerprint you compute with your own HMAC key. Unirail can recognise the same account next time but can't reverse the fingerprint. It rejects any request with a field it doesn't expect, such as a name.
How Decide mode keeps names and account numbers outSent to Unirail
- Operation
- Countries and currency
- Amount or amount band
- Bank ids
- Payto scheme names
- Account fingerprints
Stays with you
- Names
- Account numbers
- Emails and addresses
- Provider credentials
- Your fingerprint key
-
What the decision contains
Unirail answers with the provider and rail to use, what it will cost under your own contracts, the ETA and how likely it is to succeed. You also get the ranked alternatives, the options it ruled out with a reason for each, the policy version and a digest you can bind your user's approval to.
How Unirail ranks providers for each paymentDecision · routedExample values
- Use
- Provider A · Pay by bank
- Cost
- £0.15 under your contract
- ETA
- 9 s at p50
- Success
- 99% likely
- Alternative
- Provider B · £0.22 · 7 s · 98%
- Ruled out
- Provider C · no coverage for this payment in GB
- Policy
- v12 · digest 3f9c…e21a
-
Your backend calls the provider
@unirail/executorruns Unirail's provider adapters inside your own process. Your backend uses it to call Provider A with credentials from your own vault. In Decide mode those credentials never leave your platform.With Execute via Unirail, Unirail makes this call for you using the credential from your vault.
How your credentials stay in your vaultWho calls whom
- Your vault → your backend
- provider credentials
- Your backend → Provider A
- the payment call
- Unirail
- not on this call
-
The payment moves between the banks
Provider A starts the payment under your contract. The £50.00 goes from the payer's bank straight to the payee's bank without passing through Unirail.
£50.00 · payer's bank to payee's bank
- Initiated by
- Provider A, under your contract
- Route
- account to account
- Through Unirail
- no funds
-
Your backend reports the outcome
Your backend sends the rail it used, the status, the latency and the provider's fee to
See how the full flow worksPOST /v1/outcomes, with no names or account numbers. Unirail uses outcomes to track reliability for each rail, operation and bank. It also counts them against your contract for the billing period. The next decision is then priced at your current volume tier.outcomes.createExample
await unirail.outcomes.create({ decision: decision.id, rail: decision.rail, status: "succeeded", latencyMs: 1840, });- Updates
- reliability per rail, operation and bank
- Counts toward
- contract usage this billing period