Prefunded accounts allow you to maintain a balance of funds to power instant on-ramps and off-ramps for your customers. They are backed by a fungible stablecoin (1:1 with USD), and the destination currency when funding is always USD.
Note: Prefunded Accounts are similar to Bridge Wallets, with one key difference:
Prefunded Accounts allow off-ramps for multiple customers from a single account using the on_behalf_of field.
Bridge Wallets restrict off-ramps to the same customer_id that owns the wallet.
This can be useful in payroll scenarios where you may want to disperse ACH payments for multiple employees using one general liquidity wallet.
Funding a prefunded account
The destination currency when funding a Prefunded Account should always be USD, regardless of what underlying currency is used for an on-chain prefunded account.
Note: Prefunded accounts do not have a dedicated API for transaction history. If you use a Transfer, Liquidation Address, or Virtual Account to fund it or initiate payments, you can use the corresponding webhooks for those API objects.
Funding via virtual account API
This creates a virtual account that automatically forwards fiat deposits to your prefunded account.
curl --location --request POST 'https://api.bridge.xyz/v0/customers/<Customer ID>/virtual_accounts' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"source": {
"currency": "usd"
},
"destination": {
"payment_rail": "prefunded",
"currency": "usd",
"prefunded_account_id": "prefunded_account_id"
}
Funding via transfer API
You can set a prefunded account as the destination of a Transfer.
curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": "100.00",
"on_behalf_of": "customer_id",
"source": {
"payment_rail": "ethereum",
"currency": "usdc",
"from_address": "0x..."
},
"destination": {
"payment_rail": "prefunded",
"currency": "usd",
"prefunded_account_id": "prefunded_account_id"
}
}'
See all 19 lines
Funding via liquidation address API
You can automatically forward crypto deposits to your prefunded account using the liquidation address api.
curl --location --request POST 'https://api.bridge.xyz/v0/customers/<Customer ID>/liquidation_addresses' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"chain": "stellar",
"currency": "usdc",
"destination_payment_rail": "prefunded",
"destination_currency": "usd",
"prefunded_account_id": "prefunded_account_id"
}
See all 12 lines
Using prefunded accounts for instant onramps
Prefunded Accounts can be used as the source when making a Transfer. The currency when using a Prefunded Account as a source should always be USD.
curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": "100.00",
"on_behalf_of": "customer_id",
"source": {
"payment_rail": "prefunded",
"currency": "usd",
"prefunded_account_id": "prefunded_account_id"
},
"destination": {
// You can set the destination to be a regular crypto address:
"payment_rail": "ethereum",
"currency": "usdc",
"to_address": "0x..."
// Or to a bridge wallet:
"payment_rail": "<Bridge Wallet chain>",
"currency": "<Bridge Wallet currency>",
"bridge_wallet_id": "<Bridge Wallet id>"
// Or to an external address:
payment_rail: "wire",
currency: "usd",
wire_message: "<wire message>",
external_account_id: <External Account id>,
}
}'
See all 31 lines
{
"id" : "tr_123456" ,
"state" : "in_review" ,
"currency" : "usd" ,
"amount" : "100.00" ,
"source" : {
"payment_rail" : "prefunded" ,
"currency" : "usd" ,
"prefunded_account_id" : "pref_789" ,
"prefunded_account" : "account_name"
},
"destination" : {
"payment_rail" : "ethereum" ,
"currency" : "usdc" ,
"to_address" : "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6"
},
"receipt" : {
"initial_amount" : "100.00" ,
"developer_fee" : "0.00" ,
"exchange_fee" : "0.00" ,
"subtotal_amount" : "100.00" ,
"remaining_prefunded_balance" : "900.00" ,
"final_amount" : "100.00" ,
"gas_fee" : "0.00"
}
}
See all 26 lines