Fiat to Stablecoin (Pay-in)
Understanding a Pay-in
UnblockPay's API enables you to convert fiat currencies into stablecoins and transfer them to blockchain wallets — either wallets managed by UnblockPay or external wallets. This process is called a Pay-in (also known as an on-ramp).
To create a pay-in, first you need to create a Customer and a Wallet.
How to create or manage a Pay-in
Step 1: Create a quote - POST v1/quote
This endpoint returns a fresh exchange rate for converting fiat money into stablecoins. The quote is valid for 5 minutes and returns a unique id you'll reference when initiating the pay-in.
In the request body, set "type": "on_ramp", specify the sender with the fiat currency and local payment_rail, and the receiver with the stablecoin currency and blockchain payment_rail. You can optionally include an amount on either side and a partner_fee to apply a markup on top of UnblockPay's rate.
Currently supported fiat currencies (pay-in / on-ramp):
|
Fiat currency |
|
|---|---|
|
BRL |
pix |
|
USD |
wire |
|
MXN |
spei |
Currently supported stablecoins and blockchains (pay-in / on-ramp):
|
USDC |
USDT |
|
|---|---|---|
|
Solana |
✅ |
✅ |
|
Ethereum |
✅ |
✅ |
|
Polygon |
✅ |
✅ |
|
Tron |
coming soon |
✅ |
|
Base |
✅ |
coming soon |
|
Arbitrum |
coming soon |
coming soon |
Step 2: Initiate a fiat to stablecoin pay-in - POST /payin
This endpoint initiates the pay-in process by creating a transaction that converts fiat money into stablecoins and sends the tokens to a blockchain wallet. You'll need to provide the quote_id from the previous step, along with customer_id, sender, and receiver information.
The pay-in amount is not passed here, it's already fixed by the quote (
quote_id).
You can send stablecoins to either a wallet managed by UnblockPay (using wallet_id) or an external blockchain wallet (not managed by UnblockPay - using address).
After initiating a pay-in, we will send a webhook with the event type payin.created.
The sender object will include:
|
Parameter |
Definition |
Required when |
Example |
|---|---|---|---|
|
|
The local payment network for initiating the pay-in. Must match the quote's |
Always |
|
|
|
The full name of the sender. |
|
|
|
|
The tax ID or government-issued number from the sender. |
|
|
|
|
The sender's 18-digit CLABE. |
|
|
For
wire(USD) pay-ins,sendercan be omitted entirely, no extra fields are required.
The receiver request object accepts:
|
Parameter |
Definition |
Example |
|
|
If sending tokens to an UnblockPay-managed wallet, this is our wallet's unique identifier where you want to send the tokens. |
|
|
|
If sending tokens to an external wallet (not managed by UnblockPay), this is the blockchain wallet address where you want to send the tokens. |
|
Since UnblockPay cannot pull funds directly from sender bank accounts, the response includes sender_deposit_instructions with the information the customer needs to send the fiat.
-
pix (BRL):
deposit_addressis a Pix Copy & Paste code — display it as-is or generate a QR code from it in your frontend. -
spei (MXN):
deposit_addressis the CLABE to deposit into. -
wire (USD): there is no
deposit_address— instead you getdeposit_message(the wire reference to include) plus abank_accountobject withbank_name,bank_account_number,routing_number,address, andbeneficiary.name.
The sender_deposit_instructions object will include:
|
Parameter |
Definition |
Example |
|
amount |
The exact amount of fiat money you need to send. |
|
|
currency |
The fiat currency you want to convert into stablecoins. |
|
|
payment_rail |
The local payment network for initiating the pay-in. |
|
|
deposit_address |
UnblockPay's bank account information where you should send fiat money. |
|
|
deposit_message |
Transfer reference message. Present only for USD (wire, ACH or SWIFT) pay-ins. |
|
|
bank_account |
Bank account details for the deposit. Present for BRL, MXN, and USD. |
- |
For Brazil, the deposit_address is a Pix QR code value. Customers can copy this code to make payments from any bank account using Pix Copy & Paste. You can also generate and display a QR code in your frontend.
The transaction will be created in an awaiting_deposit status, and you'll receive deposit instructions for sending fiat currency.
Once we detect the fiat deposit, the status will be updated to processing and we'll automatically process the conversion and initiate the stablecoin transfer to the receiver.
The finished_at field is only populated when the pay-in reaches a final status.
If you want to understand our fee structure, please check the Fee section.
Transactional Fees
View transaction details - GET v1/transactions/{id}
This endpoint allows you to check the status and details of a transaction at any time. You'll need the transaction ID that was returned when you initiated the pay-in.
Cancel a transaction - PUT v1/transactions/{id}
This endpoint allows you to cancel a transaction that is still in the awaiting_deposit status. You cannot cancel pay-ins that are in other statuses. Once cancelled, the transaction cannot be resumed and you'll need to create a new one if needed.
After canceling a pay-in, we will send a webhook with the event type payin.cancelled.
Pay-in API endpoints
Here are the endpoints you'll need to create, list or cancel a pay-in transaction:
-
POST v1/quote: Create a stablecoin/fiat quote -
POST v1/payin: Initiate fiat to stablecoin pay-in transaction -
GET v1/transactions/{id}: View details of a specific transaction -
PUT v1/transactions/{id}: Cancel a transaction (only available for transactions withawaiting_depositstatus)
For the full schema and request/response details, see the API Reference.