Skip to main content
A payment route is a persistent pathway between a fiat source and a crypto destination (onramp), or a crypto source and a fiat destination (offramp). Creating a payment route doesn’t move any money. Rain returns the details a sender uses to fund the route, and money moves only when the sender sends funds to it.

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 (usdc or rusd), 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
onrampofframp
PartnerPOST /payment-routes
DirectionOnramp or offramp?
Rain · onrampConverts to stablecoin
ResponseVirtual account (ACH/wire)
Rain · offrampConverts to fiat
ResponseOnchain deposit address
  • POST /payment-routes: the partner calls the endpoint with a source and destination.
  • 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.
The sender or receiver doesn’t have to be the customer. Anyone can fund a route on the customer’s behalf.

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
1PartnerPOST /payment-routes
2RainReturns the route
3PartnerShares with sender
4SenderFunds the route
5RainConverts and settles
6WebhooktransactionTransfer
The steps above, in text:

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.
Rain also subjects payment routes to regional and industry restrictions. Check those before you create one.

Create an onramp payment route

Call POST /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

Call POST /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.
The response includes an onchain depositAddress. Share this with the sender so they can send stablecoin to the route.
Only send the exact source currency to a depositAddress. Sending other tokens or currencies may result in failed conversions or loss of funds.

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": "..." }. A flat amount is in the source currency; a variable amount 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, call GET /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).
To retrieve a single payment route, call GET /payment-routes/{paymentRouteId}.
To update a payment route, call 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.
To remove a payment route, call 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.