Endpoint MigrationThe
/v1/automations endpoints have been renamed to /v1/payment-routes. The old /v1/automations paths remain available as deprecated aliases during migration. Update your integrations to use /v1/payment-routes as the deprecated endpoints will be removed in a future release.Overview
Onramps let your users convert fiat to stablecoin through a persistent payment route. When you create an onramp payment route, Rain generates a virtual account with unique banking credentials. Any funds sent to that virtual account are automatically converted to the destination stablecoin and delivered to the destination onchain address. Rain supports USD onramps over ACH and wire, and MXN onramps over SPEI. See MXN onramps for the differences.Before you begin
Make sure you have:- API access to the payment routes endpoints.
- A destination address: an onchain wallet address where converted stablecoin is delivered. This can be a Rain smart contract or an external wallet.
- A bank account: your end users need a US bank account to initiate USD transfers, or a Mexican bank account to initiate MXN transfers over SPEI.
Restrictions
Onramp payment routes are subject to the same restrictions & availability rules as any other payment route, plus Rain’s Payments compliance checks. Rain also screens each deposit into a payment route and checks it against your program’s partner-managed limits. A deposit that Rain holds for review shows the transfer statuspending_review until Rain releases or returns it.
Key concepts
Payment routes
A payment route creates a persistent pipe between a source and destination. For onramps:- Source: fiat via ACH or wire transfer (USD), or SPEI (MXN).
- Destination: an onchain address on a supported chain.
depositAddress containing virtual account banking credentials. This virtual account acts as the named beneficiary for incoming fiat transfers. See What a payment route is for how Rain determines direction for both onramps and offramps.
Virtual accounts
Virtual accounts are dedicated banking credentials that Rain generates for receiving fiat transfers, not payment accounts you register yourself. Each onramp payment route generates its own virtual account, giving your users unique ACH and wire transfer details.First-party and third-party transfers
Virtual accounts support both first-party and third-party incoming transfers:- First-party: the user who owns the payment route sends funds from their own bank account.
- Third-party: a different party sends funds to the virtual account on behalf of the user, for example an employer funding an employee’s account.
API flow
Action / API callExternal / userWebhook Rain sends you
Create an onramp payment route
To create an onramp payment route, callPOST /payment-routes with a fiat
source and an onchain destination. See Create an onramp payment
route for the full
request, response, and field reference; the shape is identical for onramps
created from this page.
Destination address formatThe destination address must match the expected format for the destination rail:
- EVM chains (Ethereum, Base, Polygon, Arbitrum, Optimism, Avalanche): must be a valid EVM address starting with
0xfollowed by 40 hexadecimal characters (for example,0x1234567890abcdef1234567890abcdef12345678). - Solana: must be a valid Solana address in base58 format (32-44 characters).
MXN onramps
MXN onramps follow the same flow as USD onramps, with MXN as the source currency and SPEI as the rail. The API flow, webhooks, transfer transactions, and error handling on this page apply unchanged. Only the request and the deposit address differ.Create the payment route
Setsource.currency to mxn and source.rail to mx_spei. The destination is an onchain address, as for USD onramps.
Optionally, set transferMessage to add a memo to every transaction the route creates. On every payment route, the memo can be up to 23 characters, and only ASCII letters, numbers, and spaces are allowed. destination.referenceId is a deprecated alias for the same value. If you send both, transferMessage takes precedence. This memo is separate from the transferMessage that Rain returns in the route’s depositAddress, described below.
Deposit address
For MXN onramps, the route’sdepositAddress carries a CLABE (clabeNumber, Clave Bancaria Estandarizada) and a transferMessage reference that Rain generates, instead of a US account number and routing number:
transferMessage as the transfer’s concepto, so Rain can match the deposit. A transfer that omits the concepto may not be matched to the route. Rain then converts the funds to the destination stablecoin and delivers them to the onchain address.
Manage payment routes
UseGET /payment-routes, GET /payment-routes/{paymentRouteId},
PATCH /payment-routes/{paymentRouteId}, and
DELETE /payment-routes/{paymentRouteId} to list, retrieve, update, and remove
onramp payment routes. Only transferMessage and senderFees can change on an
onramp route, and MXN routes can’t be updated. See Manage payment
routes for the full request
and response examples.
What happens when funds are received
When a user sends funds to the virtual account:- Funds received: Rain receives the fiat transfer at the virtual account. Deposits under $2.00 don’t create a transfer. Rain sends a
microDeposit.receivedwebhook instead. - Transfer created: Rain creates a transaction of type
transferand sends atransactionTransferwebhook with actioncreated. - Conversion: Rain automatically converts funds to the destination stablecoin.
- Transfer: Rain sends stablecoin to the destination onchain address.
- Transfer completed: the transfer reaches a final state, and Rain sends a
transactionTransferwebhook with actioncompleted.
Webhooks
Rain sends webhooks through the transfer lifecycle:
There is no separate failure webhook. A returned deposit arrives as
updated with status refunded; see Refund reasons. See Money Movement Webhooks for how a transfer moves through these events, and the transfer object reference for the full webhook payload schema.
Transfer transaction
Each successful onramp creates atransfer transaction that you can query via
the Transactions API. Filter
by type=transfer to see all transfer transactions.
Example transfer transaction response:
Settlement times
Transfer times vary by rail:
After fiat settlement, the conversion and onchain transfer typically complete within minutes.
Cutoff times
ACH and wire processing is subject to banking cutoff times. Transfers received after the cutoff are processed on the next business day.ACH and wire cutoff times apply on US business days only. ACH and wire
transfers initiated on weekends or US federal holidays are processed on the
next business day. SPEI transfers aren’t affected.
Supported configurations
Source (fiat)
Destination (crypto)
MXN onramps are enabled per program. Contact your Rain representative to turn them on.
Rain regularly adds additional currencies and chains. Contact your Rain
representative for the latest supported configurations.
Error handling
Errors return the HTTP status, its reason, and a message. Schema validation errors also carry"code": "FST_ERR_VALIDATION".
Best practices
- Monitor webhooks: set up webhook handlers to track transfer status in real time instead of polling.
- Handle failures gracefully: fiat transfers can fail due to bank issues on the sender’s side. Implement retry logic and user notifications.
- Validate destination addresses client-side: catch malformed onchain addresses before calling
POST /payment-routesto avoid a round trip on an avoidable error.
What’s next
Payment routes
See the full request, response, and field reference shared by onramps and offramps.
Set up offramps
Enable fiat withdrawals from crypto.
Partner-managed limits
Set limits on onramp and offramp volume and handle deposits that exceed them.
Set up webhooks
Receive transfer notifications as they happen.