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
Prerequisites
Before you start, make sure you have:- API keys from the Dashboard (Get API keys)
- A tool for making API calls (cURL, Postman, or similar)
- Basic understanding of REST APIs
- Your sandbox endpoint:
https://sandbox.hifibridge.com
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.
What you’ll build
Here’s what we’ll accomplish in this recipe:- Generate API Keys - Set up authentication for HIFI API
- Create Business A (Payer) - Onboard US business and complete KYB for USD rail
- Add Virtual Account - Set up account for USD deposits that convert to USDC
- Create Business B (Payee) - Onboard Hong Kong supplier (or use existing business)
- Execute Payment - Send USDC from Business A → HKD to Business B’s bank account
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.Get Your API Keys
Get Your API Keys
Steps:For a complete guide on API authentication, see our Authentication Documentation.
- Navigate to dashboard.hifibridge.com
- Log in to your account
- Go to Developer → API Keys
- Click Generate New Key
- Select your environment: Sandbox (for testing) or Production (for live transactions)
- Copy the key immediately - it’s only shown once
- Store your API key securely (environment variables, secrets manager, etc.)
- Never commit API keys to version control
- Your key authenticates all HIFI API requests
- If compromised, immediately revoke in the Dashboard and generate a new one
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.
Business Creation Flow
Creating a business user involves four steps:- Generate Terms of Service Link - Get acceptance link for your business
- Create Business User - Create the business account after TOS acceptance
- Update KYB Information - Provide required business details and UBO information
- Submit KYB - Submit for verification to unlock USD rail
Generate Terms of Service Link
Generate Terms of Service Link
Before creating a business user, they must accept HIFI’s Terms of Service. Generate a unique acceptance link using the Generate Terms of Service Link endpoint.Request:Request Fields:Response:Response Fields:What to do with this response:
A unique UUID that becomes your
signedAgreementId after the business accepts
the terms. Generate this using any UUID
generator.Optional template ID for custom Terms of Service templates.
Optional URL to redirect users after they accept the terms.
The unique link where the business will review and accept HIFI’s Terms of
Service.
The agreement ID (same as your
idempotencyKey). Save this - you’ll need
it to create the business user in the next step.- Direct the business to the
url- Send this link via email or embed in your application - Save the
signedAgreementId- You’ll need this to create the business user - Wait for acceptance - The
signedAgreementIdbecomes valid only after they click “Accept”
Real-time Notifications: HIFI triggers the
TOS_LINK.UPDATE webhook event
when the business accepts the terms, allowing you to proceed with user
creation immediately. Learn about webhooks →Create Business User
Create Business User
Once the business has accepted the Terms of Service, create the business user account with the Create User endpoint.Request:Request Fields:Response:✅ Business user created successfully!Response Fields:What you get:
Unique identifier (UUID) for this request to ensure idempotency.
User type. Use
business for business accounts.Blockchain networks to provision wallets on. Options:
POLYGON, ETHEREUMBusiness email address.
Date associated with the business registration (YYYY-MM-DD format).
Business address.
IP address of the business representative creating the account.
The
signedAgreementId from the Terms of Service acceptance.Legal name of the business.
Array of Ultimate Beneficial Owners (UBOs) who own or control the business.
The unique business user ID. Save this - you’ll use it for all future
operations with this business.
Automatically provisioned wallet addresses on supported blockchain networks.
- Business User ID (
94dcd5c2-4508-593d-9302-fd7a5444eb20) - Save this for all future operations - Wallet addresses - Pre-provisioned on multiple blockchains, ready for instant transfers
Automatic Wallet Provisioning: Every business user automatically receives
wallet addresses on supported blockchain networks. These wallets are fully
functional immediately - no additional setup required.
Update KYB Information
Update KYB Information
Provide the required business information for KYB (Know Your Business) verification using the Update KYC endpoint.Request:Request Fields:Response:The response includes comprehensive business information including UBO details, business structure, compliance questionnaires, and uploaded documents. The full response structure includes:
KYB vs KYC: While the endpoint is named “KYC,” it handles both individual
(KYC) and business (KYB) verification. For businesses, you’ll provide company
details, tax information, and Ultimate Beneficial Owner (UBO) documentation.
Business name (can be used for additional identification).
Country where the business is registered (ISO 3166-1 alpha-3 country code).
Business tax identification number (e.g., EIN for US businesses).
- Basic business information (name, email, address, tax details)
- Ultimate Beneficial Owners with their personal information and documents
- Business formation documents
- Compliance screening information
- Uploaded verification documents
Document Upload: For a complete KYB submission in production, you’ll need
to upload various business documents including: incorporation articles,
business registration, proof of address, and UBO identification documents. See
the Business User Guide for detailed document requirements. In
sandbox, KYB may be automatically approved with minimal documentation.
UBO Document Upload: UBO (Ultimate Beneficial Owner) details are handled via a
separate Add a UBO endpoint. After you create a UBO, save the uboId from the response
and use it when calling the Add Documents endpoint so the files are attached to that specific UBO.
Submit KYB for USD Rail
Submit KYB for USD Rail
Submit the KYB application to unlock the USD rail using the Submit KYC endpoint.Request:Request Fields:Response:✅ KYB application submitted!Response Fields:KYB Review Process:
The currency rail to unlock. Use
USD for US Dollar operations.Status information for the USD rail submission.
- Status starts as
CREATED(immediate) - Transitions to
PENDING(within minutes in sandbox) - Final status:
ACTIVEorREJECTED(typically automatic in sandbox, 3-7 business days in production)
Business Verification Timeline: Business KYB verification typically takes
longer than individual KYC due to additional compliance requirements. In
production, expect 3-7 business days for review. Monitor the status using the
Retrieve KYC
Status
endpoint or subscribe to
KYC.STATUS_UPDATE webhook events.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.
Create Virtual Account
Create Virtual Account
A Virtual Account enables Business A to deposit USD from their bank, which automatically converts to USDC on Polygon for international payment distribution.Request:Request Fields:Response:✅ Virtual account created!Response Fields:
Fiat currency to deposit. Use
usd for US Dollars.Stablecoin to receive after conversion. Use
usdc for USD Coin.Blockchain network for the stablecoin. Options:
POLYGON, ETHEREUMOptional external wallet ID if using a wallet outside HIFI’s custody.
The unique virtual account ID. Save this for monitoring deposits.
Account status.
activated means it’s ready to receive deposits.Banking partner providing the virtual account infrastructure.
Source configuration for fiat deposits.
Destination configuration for crypto conversion.
Most Important: Bank account details Business A needs to send money to.
How to Use: Provide these deposit instructions to Business A. When they
send money to this account via wire transfer or ACH, HIFI automatically
detects the deposit, converts it to USDC, and sends it to their wallet. The
USDC is then available for international payments. For monitoring deposits,
subscribe to
ONRAMP.CREATE webhook events.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
- Use Hong Kong business information and address details
- Submit KYB for the Hong Kong rail
- Add an Offramp Account (Hong Kong bank account) instead of a Virtual Account
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:- Create offramp request - Get a quote for the conversion
- Accept the quote - Execute the payment
Complete Offramp Guide: For more details on offramps and cross-border
transfers, see our Offramp Transfer Guide.
Create Offramp Request
Create Offramp Request
Create an offramp request to get a quote for converting 10 USDC to HKD using the Create an offramp endpoint.Request:Request Fields:Response:✅ Offramp quote created!Response Fields:Understanding the Quote:In this example:
Unique identifier (UUID) for this offramp request to ensure idempotency.
Purpose of the payment for compliance. Common values for B2B:
payment_for_services, payment_for_goods, invoice_payment,
contract_payment, etc.Type of supporting document if required. Options:
billing_document,
invoice, contract, purchase_order, etc.URL to the supporting document if required by regulations.
Description of the payment (e.g., invoice number, contract reference).
Source of the offramp (crypto side - Business A).
Destination of the offramp (fiat side - Business B).
Optional: Developer fees to collect on the transaction.
Unique offramp transaction ID. Save this - you’ll need it to accept the
quote and monitor status.
Transfer type. Always
OFFRAMP for cross-border payment transactions.Current status.
OPEN_QUOTE means you have an active quote waiting to be
accepted.Source details showing Business A’s wallet and amount being sent.
Destination details showing Business B’s bank account and amount they’ll
receive.
Critical: Detailed breakdown of the conversion including exchange rate,
fees, and amounts.
- 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
Accept Quote and Execute Payment
Accept Quote and Execute Payment
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:OPEN_QUOTE- Quote generated, waiting for acceptanceCRYPTO_INITIATED- Processing crypto conversionCRYPTO_PENDING- Waiting for blockchain confirmationFIAT_PENDING- Converting to HKD and initiating bank transferCOMPLETED- HKD deposited to Business B’s Hong Kong bank account
- Polling: Call Retrieve an offramp with the transaction ID (
63b7f9de-31e9-4726-bf5c-b4f21a6af796) - Webhooks: Subscribe to
OFFRAMP.UPDATEevents for real-time status notifications
- 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