Use Case Overview
This recipe demonstrates a marketplace payment where:- ✅ User A deposits USD from their bank account
- ✅ USD automatically converts to USDC stablecoin
- ✅ USDC is transferred to User B wallet
- ✅ USDC is converted to HKD and sent to User B’s bank account
What you’ll build
Here’s what we’ll accomplish in this recipe:- Add Virtual Account (Buyer / User A) - Set up account for USD deposits that convert to USDC
- Create Business User B (Seller) - Onboard Hong Kong seller
- Execute Payment - Send USDC from User A wallet to User B wallet
- Initiate Offramp - Convert crypto funds from User B’s wallet to User B HKD bank account
All examples in this guide use the sandbox environment. When you’re ready for
production, simply replace the sandbox URL with the production endpoint and
use your production API keys.
Prerequisites
Before you begin, make sure you have: User A – Individual user created and KYC submitted withstatus = active
User B – Business user created and KYB submitted with status = active
For a complete guide on user onboarding, see:
Add Virtual Account (Buyer)
The buyer needs a Virtual Account for onramping. This is a bank account number automatically created by HIFI that User A can deposit USD into. When fiat arrives, it’s automatically converted to USDC and sent to their wallet.Complete Virtual Account Guide: For more details on virtual accounts and
onramping, see our Virtual Accounts Guide.
Create Virtual Account
Create Virtual Account
Request:Response:
Create Business B (Seller)
The seller (Business B in Hong Kong) needs a wallet address to receive the payment. This is created automatically when the business user is onboarded. Some sellers may choose to use a separate wallet dedicated to marketplace-related activity to make tracking incoming payments easier.Using an Existing Business: If Business B already exists in your system,
you can skip business creation and just ensure they have an active wallet
address and Hong Kong bank account for later offramping. You’ll need either
their userid or walletaddress for the crypto transfer.
Required Information
To complete this recipe, you’ll need:- Business B’s
userId- From creating their business account - Business B’s
walletAddress- Provisioned upon creating the business user - Business B’s HKD
accountId- From adding their Hong Kong bank account
Execute Payment
Now you can send the wallet transfer payment from User A (US) to Business B (Hong Kong). Create a crypto transfer that sends USDC from User A’s wallet to Business B’s wallet.Transfers can be sent to other HIFI users or external wallet addresses. For
this example, we will send to another HIFI user (Business B).
- Create crypto transfer request - Mark
requireApprovalas true in the request fields (User A) - Accept the transfer approval - Accept the approval through the Approve a transfer endpoint (Business B)
Create Crypto Transfer Request
Create Crypto Transfer Request
Create a crypto transfer request that requires approval by setting Request Fields:Response:Response Fields:
👉 Transfer Approvals Guide
requireApproval: true in the Create a Crypto Transfer endpoint.Request:Unique identifier (UUID) for this transfer request to ensure idempotency.
Source cryptocurrency (e.g., usdc, usdt).
Amount of USDC to send from User A’s wallet.
Blockchain network (e.g., POLYGON, ETHEREUM).
Source of the transfer (User A).
Destination of the transfer (Business B)
Unique crypto transfer transaction ID.
Transfer type.
Current status.
PENDING_APPROVAL means you have an active transfer approval
waiting to be accepted.Source details showing User A’s wallet.
Destination details showing Business B’s wallet info.
Amount of USDC being transferred.
Transfer approval details.
Understanding Transfer Approvals
After submitting a transfer request withrequireApproval: true:- The transfer status becomes PENDING_APPROVAL and does not execute
- Dashboard admins receive email notifications about the pending approval
- Authorized admins review and either approve or reject the transfer
- If approved → transfer executes normally. If rejected, transfer is cancelled
👉 Transfer Approvals Guide
Execute Offramp
With the approved transfer, Business B can now transfer the USDC from their wallet into their HKD bank account. This is a two-step process:- Create offramp request - Get a quote for the conversion
- Accept the quote - Execute the payment
Required Information
In order to execute the offramp and complete this recipe, follow these steps:- Create an offramp request with the source (wallet, chain, amount) and destination (fiat account), optionally including developer fees.
- Review the returned quote—rate, fees, send/receive amounts, and expiration—in
transferDetails.quoteInformation. - Confirm status is
OPEN_QUOTEand savetransferDetails.idto track and accept the quote. - Accept the quote via
POST /v2/offramps/{id}/quote/acceptto convert stablecoins to fiat and initiate payout. - Monitor statuses through crypto and fiat phases (e.g.,
CRYPTO_INITIATED→ completion) using the receipt fields or webhooks.
🎉 Congratulations!
You’ve successfully completed a marketplace payment! By following this recipe, you can now:- ✅ Create virtual accounts for fiat-to-crypto conversion
- ✅ Execute marketplace payments with transfer approvals
- ✅ Provide transparent fee structures and quote expiration
Next Steps
Ready to build a full marketplace payment platform? Here’s what to explore next:- Webhooks - Set up real-time notifications for transaction status updates and user engagement
- Offramp Guide - Deep dive into offramp transactions and compliance requirements
- Onchain Transfers - Learn how to initiate and track onchain wallet-to-wallet transfers
- Transfer Approvals - Configure optional approvals for higher-control transfer workflows
- Error Handling - Implement robust error handling for failed transactions and expired quotes
- API Reference - Explore all available endpoints and parameters for advanced features