Overview
HOST Pay’s Escrow Service allows applications to hold funds securely in a temporary state. This is ideal for marketplaces, service platforms, or any transaction where trust needs to be established before funds are finalized.How It Works
The escrow flow consists of three main actions: Hold, Release, and Refund.Configuration
Enabling Escrow
Escrow must be enabled in your application’s settings within the Dashboard or via the API. If disabled, calls to escrow endpoints will return a403 Forbidden error.
Escrow Fees
You can configure an Escrow Release Fee. This fee is a percentage deducted from the total amount at the time of release to the recipient.1. Holding Funds
To initiate an escrow hold, use the Hold Funds endpoint.- Sender: The user wallet from which funds will be deducted.
- Amount: The total amount to be held in escrow, specified in your application’s base currency (e.g., USD or SLE).
- Status: The transaction will move to a
HELDstate.
JavaScript
2. Releasing Funds
When your application confirms that the transaction conditions have been met (e.g., product delivered), use the Release Funds endpoint.- Transaction ID: The ID of the original
HELDtransaction. - Recipient: The wallet that will receive the funds.
- Partial Release: You can release a portion of the funds or the full amount.
JavaScript
3. Refunding Funds
If the transaction cannot be completed, you can return the funds to the sender using the Refund Funds endpoint.- No Fees: Typically, escrow refunds do not incur the escrow release fee.
- Status: The original transaction status updates to
REFUNDED.
Best Practices
- Timeout Management: Implement logic to automatically refund or flag escrow holds that have been “pending” for too long.
- Partial Releases: Use partial releases for milestone-based payments in long-running projects.
- Webhooks: Listen for
transfer.succeededandtransaction.updatedevents to keep your local database in sync with escrow state changes.
Related Topics
Wallet Management
Manage user balances
Webhooks
Automate your escrow logic