Skip to main content
⏱️ Time to complete: 35-45 minutes 🎯 What you’ll build: A complete cross-border payment flow where a US business pays a Hong Kong supplier, converting USD → USDC → HKD with instant settlement and competitive rates.

Use Case Overview

This recipe demonstrates an international B2B payment where:
  • ✅ US business deposits USD from their bank account
  • ✅ USD automatically converts to USDC stablecoin
  • ✅ USDC transfers instantly across borders
  • ✅ HKD is deposited to supplier’s Hong Kong bank account
This flow enables fast, cost-effective international business payments with transparent pricing and instant settlement.

What you’ll build

Here’s what we’ll accomplish in this recipe:
  1. Generate API Keys - Set up authentication for HIFI API
  2. Create Business A (Payer) - Onboard US business and complete KYB for USD rail
  3. Add Virtual Account - Set up account for USD deposits that convert to USDC
  4. Create Business B (Payee) - Onboard Hong Kong supplier (or use existing business)
  5. Execute Payment - Send USDC from Business A → HKD to Business B’s bank account
Payment Flow:
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.

Generate API Keys

Access to the HIFI API requires authentication via API keys. Generate your keys from the HIFI Dashboard before making any API calls. Be sure to copy the key immediately as it’s only shown once. For a complete guide on API authentication, see our Authentication Documentation.
Include your API key in the Authorization header of all API requests:

Create Business A (US Payer)

The paying business needs a verified business account to access fiat rails and send international payments. Every business must accept HIFI’s Terms of Service and complete KYB (Know Your Business) verification before they can move money between fiat and crypto.
Complete Business Onboarding Guide: For a comprehensive walkthrough of business onboarding and KYB verification, see our Business User Guide.
Request:
Response:
Request:
Response:The response includes comprehensive business information including UBO details, business structure, compliance questionnaires, and uploaded documents.
Request:
Response:

Add Virtual Account (Business A)

Now that Business A has passed KYB, create a Virtual Account for onramping. This is a bank account number automatically created by HIFI that the business 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.
Request:
Response:

Create Business B (HK Payee)

The recipient business (Business B in Hong Kong) needs a business account with an HKD bank account to receive the payment. Follow the same business creation flow as Business A, but complete KYB for the appropriate Hong Kong rail.
Using an Existing Business: If Business B already exists in your system, you can skip business creation and just ensure they have an active Hong Kong bank account. You’ll need their userId and accountId for the payment transaction.

Required Information

To complete this recipe, you’ll need:
  • Business B’s userId - From creating their business account
  • Business B’s HKD accountId - From adding their Hong Kong bank account
For the complete flow of creating Business B and adding their HKD bank account, follow the same steps as Business A but:
  1. Use Hong Kong business information and address details
  2. Submit KYB for the Hong Kong rail
  3. Add an Offramp Account (Hong Kong bank account) instead of a Virtual Account
For detailed instructions on adding offramp accounts for international recipients, see our Offramp Guide.

Execute Payment

Now you can send the international payment from Business A (US) to Business B (Hong Kong). Create an offramp transaction that converts USDC to HKD and sends it to Business B’s Hong Kong bank account. This is a two-step process:
  1. Create offramp request - Get a quote for the conversion
  2. Accept the quote - Execute the payment
Complete Offramp Guide: For more details on offramps and cross-border transfers, see our Offramp Guide.
Create an offramp request to get a quote for converting 10 USDC to HKD using the Create an offramp endpoint.Request:
Request Fields:
string
required
Unique identifier (UUID) for this offramp request to ensure idempotency.
string
Purpose of the payment for compliance. Common values for B2B: payment_for_services, payment_for_goods, invoice_payment, contract_payment, etc.
string
Type of supporting document if required. Options: billing_document, invoice, contract, purchase_order, etc.
string
URL to the supporting document if required by regulations.
string
Description of the payment (e.g., invoice number, contract reference).
object
required
Source of the offramp (crypto side - Business A).
object
required
Destination of the offramp (fiat side - Business B).
array
Optional: Developer fees to collect on the transaction.
Response:
Offramp quote created!Response Fields:
string
Unique offramp transaction ID. Save this - you’ll need it to accept the quote and monitor status.
string
Transfer type. Always OFFRAMP for cross-border payment transactions.
string
Current status. OPEN_QUOTE means you have an active quote waiting to be accepted.
object
Source details showing Business A’s wallet and amount being sent.
object
Destination details showing Business B’s bank account and amount they’ll receive.
object
Critical: Detailed breakdown of the conversion including exchange rate, fees, and amounts.
Understanding the Quote:In this example:
  • Business A sends 10 USDC
  • After fees (tax: 0.170 USDC, rail: 0.100 USDC), 9.73 USDC is converted
  • At a rate of 7.56 HKD per USDC
  • Business B receives 75.63 HKD in their Hong Kong bank account
Quote Expiration: Quotes typically expire after 15-30 minutes to protect against exchange rate volatility. If your quote expires before acceptance, create a new offramp request for a fresh quote with updated rates.
After reviewing the quote, exchange rate, and fees, accept it to execute the cross-border payment using the Accept Quote endpoint.Request:
Response:
Quote accepted! Cross-border payment is processing.The status has changed from OPEN_QUOTE to CRYPTO_INITIATED, meaning the transaction is now being executed.Cross-Border Payment Status Progression:
  1. OPEN_QUOTE - Quote generated, waiting for acceptance
  2. CRYPTO_INITIATED - Processing crypto conversion
  3. CRYPTO_PENDING - Waiting for blockchain confirmation
  4. FIAT_PENDING - Converting to HKD and initiating bank transfer
  5. COMPLETED - HKD deposited to Business B’s Hong Kong bank account
Monitoring Payment Status:Track the payment progress using:
  • Polling: Call Retrieve an offramp with the transaction ID (63b7f9de-31e9-4726-bf5c-b4f21a6af796)
  • Webhooks: Subscribe to OFFRAMP.UPDATE events for real-time status notifications
Settlement Times:
  • Sandbox: Instant simulation for testing
  • Production: Typically 1-3 business days depending on the destination country’s banking system and payment rail
Business Payment Notifications: Consider implementing webhook handlers to send notifications to both Business A (payer) and Business B (recipient) as the payment progresses. Include transaction details, exchange rates, and expected settlement times to provide transparency and improve cash flow management.

🎉 Congratulations!

You’ve successfully completed a cross-border business payment! By following this recipe, you can now:
  • ✅ Generate API keys and authenticate with HIFI
  • ✅ Onboard businesses and complete KYB for multiple currency rails
  • ✅ Create virtual accounts for fiat-to-crypto conversion
  • ✅ Execute international payments with instant settlement via stablecoins
  • ✅ Provide transparent fee structures and competitive exchange rates

Next Steps

Ready to build a full cross-border payment platform? Here’s what to explore next:
  • Webhooks - Set up real-time notifications for payment status updates and settlement confirmations
  • Rails Overview - Explore additional currency corridors to expand your global payment coverage
  • Offramp Guide - Deep dive into offramp transactions, compliance requirements, and settlement rules
  • Business User Guide - Learn about KYB requirements, UBO verification, and business document management
  • Error Handling - Implement robust error handling for failed transactions, expired quotes, and compliance issues
  • API Reference - Explore all available endpoints and parameters for advanced features