Deposit Intents
A Deposit Intent configures where a user’s deposits should be routed. It creates a unique deposit address and stores the destination chain, token, and recipient address.Create Deposit Intent
Create or update a deposit intent for a user. Endpoint:POST /api/deposit-intents
Authentication: Required (API Key)
Request
Headers:| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | Unique identifier for your user |
targetChainId | number | Yes | Destination chain ID (e.g., 137 for Polygon) |
targetTokenAddress | string | Yes | EVM address of target token |
targetAddress | string | Yes | EVM address to receive funds |
Response
Status:200 OK or 201 Created
| Field | Type | Description |
|---|---|---|
userId | string | User identifier |
depositAddress | string | Unique address for user to send deposits |
targetChainId | number | Destination chain ID |
targetChainKey | string | Human-readable chain identifier |
targetTokenAddress | string | Token address on destination chain |
targetAddress | string | Recipient address on destination chain |
protocolFeeBps | number | Protocol fee in basis points (from your API key) |
sponsoredGas | boolean | Whether gas is sponsored (from your API key) |
createdAt | string | ISO 8601 timestamp of creation |
updatedAt | string | ISO 8601 timestamp of last update |
Example
Request:Error Responses
Invalid Chain ID Status:400 Bad Request
400 Bad Request
400 Bad Request
401 Unauthorized
Get Deposit Intent
Retrieve the active deposit intent for a user. Endpoint:GET /api/users/:userId/deposit-intent
Authentication: Required (API Key)
Request
Headers:| Parameter | Type | Description |
|---|---|---|
userId | string | User identifier |
Response
Status:200 OK
Example
Request:Error Responses
Not Found Status:404 Not Found
401 Unauthorized
Understanding Deposit Intents
One Intent Per User
EachuserId can have one active Deposit Intent. Creating a new intent for the same user updates the existing one.
Important: The depositAddress remains the same even when updating the intent. Only the routing destination changes.
Fee Snapshotting
When you create a deposit intent, fee settings are captured from your API key:protocolFeeBps- Snapshotted at creationsponsoredGas- Snapshotted at creation
Deposit Address Stability
ThedepositAddress is:
- Deterministic - Based on the user’s
userId - Stable - Same address across all supported chains
- Reusable - Can be used for multiple deposits
- Persistent - Doesn’t change when you update the intent
Supported Chains
ValidtargetChainId values:
| Chain | Chain ID | Key |
|---|---|---|
| Base | 8453 | base |
| Ethereum | 1 | ethereum |
| Polygon PoS | 137 | polygon |
| Arbitrum One | 42161 | arbitrum |
| Avalanche C-Chain | 43114 | avalanche |
Token Addresses
ThetargetTokenAddress must be a valid EVM address:
- For native tokens (ETH, MATIC, AVAX): Use
0x0000000000000000000000000000000000000000 - For ERC-20 tokens: Use the token contract address on the destination chain
- USDC on Polygon:
0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 - USDC on Ethereum:
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Workflow
Typical Integration Flow
- User signs up in your application
- Create deposit intent with their preferred destination
- Show deposit address to the user in your UI
- User sends funds to the deposit address
- Bridgfy detects deposit automatically via webhook
- Funds are routed to the destination specified in the intent
- Track execution via the Executions API
Updating Destinations
If a user wants to change their destination:- Call the same endpoint
POST /api/deposit-intentswith the sameuserId - Provide new destination parameters
- Intent is updated with new routing configuration
- Deposit address remains the same
Testing
Before going to production:- Use the Simulation API to verify routes exist
- Test with testnet chains and tokens
- Verify fee calculations match expectations
- Test updating intents (same userId, different destination)
Best Practices
User ID Selection
Choose auserId that:
- Is unique across your entire user base
- Is stable (doesn’t change if user updates profile)
- Is not guessable or sequential (use UUIDs)
uuid-abc-123-def-456user_clerkId_abc123- Hash of email + salt
1,2,3(sequential)[email protected](PII)user123(potentially guessable)
Error Handling
Always handle potential errors:Validation
Before creating an intent:- Validate addresses - Ensure they’re valid EVM addresses
- Validate chain ID - Confirm it’s a supported chain
- Check token support - Use simulation to verify the token can be routed
- Communicate clearly - Show users what they’re configuring
Next Steps
- Use the Routing API to simulate deposits before creating intents
- Learn about Executions to track deposit status
- Review Error Codes for troubleshooting