What a payment route is
A payment route runs in one direction:- Onramp: The source is fiat (ACH or wire) and the destination is an
onchain address. Rain returns a virtual account, converts any fiat sent to
it to stablecoin (
usdcorrusd), and delivers it to the destination address. - Offramp: The source is crypto (a stablecoin and chain) and the destination is a payment account. Rain returns a deposit address, converts any stablecoin sent to it to fiat, and delivers it to the destination account.
Partner / responseRain stepDirection
- POST /payment-routes: the partner calls the endpoint with a
sourceanddestination. - Onramp or offramp?: determined by whether the source is fiat or crypto.
- Onramp: Rain converts incoming fiat to stablecoin and returns a virtual account (ACH/wire details).
- Offramp: Rain converts incoming stablecoin to fiat and returns an onchain deposit address.
API flow
Creating a route is a single call. Everything after that happens when the sender funds it:Action / API callExternal / senderWebhook Rain sends you
Before you begin
Make sure you have:- API access to the payment routes endpoints.
- A destination address for onramps: an onchain wallet or a Rain smart contract that receives stablecoin.
- A registered payment account for offramps, as the destination bank account.
Create an onramp payment route
CallPOST /payment-routes with a fiat source and an onchain destination.
source.rail can be ach or wire. The generated virtual account supports
both rails regardless of which one you specify. Setting the primary rail
only helps with routing optimization.
The response includes a depositAddress with the virtual account’s beneficiary
and banking details. The virtual account is a named account: beneficiaryName
carries your customer’s own name, so incoming transfers are addressed to them,
not to Rain. Share these details with the sender so they can wire or ACH funds
to the route.
Create an offramp payment route
CallPOST /payment-routes with a crypto source and a fiat destination
that references a payment account id.
refundAddress is required whenever source is a crypto rail. If the
transaction can’t be completed, Rain returns the crypto to this address.depositAddress. Share this with the sender
so they can send stablecoin to the route.
Response fields
Both the onramp and offramp responses above share the same shape:Optional fields
Two more fields are accepted when you create (or later update) a route:transferMessage: a memo of up to 23 ASCII letters, digits, and spaces. It surfaces as the wire memo on USD offramps and as the SPEI concepto on MXN offramps.senderFees: an array of fees you charge the sender on every transfer the route processes, each{ "type": "flat" | "variable", "amount": "..." }. Aflatamount is in the source currency; avariableamount is a percentage below 100. Sender fees must be enabled for your program.
Supported rails
The following table lists the supported rails for each direction:
MXN routes pair the
mx_spei rail and mxn currency with usdc in either
direction. See MXN onramps and
MXN offramps for the differences.
Manage payment routes
To retrieve all payment routes for your team, callGET /payment-routes. The
response carries them in a paymentRoutes array. Filter with userId or
companyId, and page with limit (default 20, max 100) and cursor (the last
route’s id from the previous page).
GET /payment-routes/{paymentRouteId}.
PATCH /payment-routes/{paymentRouteId}. Only
transferMessage, refundAddress (offramp routes only), and senderFees can
change; the route’s source, destination, and deposit address are immutable.
MXN routes can’t be updated: delete the route and create a new one instead.
DELETE /payment-routes/{paymentRouteId}. A successful delete returns 204
with no body, and the route no longer appears in list or get responses.
What’s next
Payment Accounts
Register the external bank account an offramp payment route pays out to.
Onramps
Learn more about converting fiat to crypto through a payment route.
Offramps
Learn more about converting crypto to fiat through a payment route.
Restrictions
Review the regional and industry restrictions that apply to payment routes.