Lifecycle
- A B2B integrator requests access.
- Rails issues an API key manually.
- The integrator creates an offramp order.
- Rails settles the value on Sui.
- The configured payout route completes local fiat payout.
First principles
- Stablecoins enter the system.
- Settlement is executed on Sui, or directly on an EVM chain.
- Route A is the configured B2B route.
- Local fiat payout completes through the selected route.
Two settlement paths
Rails supports two kinds of source network, chosen by the order you create:- Sui — Rails’ own full Gateway layer. Rails settles the deposit and drives the lifecycle. Use Create Order.
- EVM & Starknet (
base,polygon,arbitrum-one,starknet, …) — settled directly against the settlement aggregator’s on-chain Gateway. Rails is non-custodial: it never holds keys or funds. It assembles thecreateOrderparameters, your wallet submits the transaction, and Rails polls status and webhooks you. Use Create Order — EVM & Starknet then Submit On-chain Order.
network you pass to POST /v1/sender/orders selects the path — one
endpoint for all chains.
Non-custodial (EVM / Starknet) order lifecycle
POST /v1/sender/orderswith an EVM/Starknetnetwork→ Rails returns unsignedcreateOrderparams and anorderRef.- Your wallet
approve()s the Gateway and callscreateOrder(...). POST /v1/sender/orders/{id}/submittedwith the on-chainorderId.- Rails polls the settlement aggregator and webhooks you on
settled/refunded/expired.
returnAddress that created the order.
Failure modes
- Quote expires before payment
- Fiat payout does not complete
- Route times out
- A retry must be issued
What to expect from the app layer
Your application should treat settlement as a state machine, not a single request/response call. That means you should handle:- pending
- quoted
- created
- settling
- settled
- failed
- expired