Deposit Asset
Create a deposit for Lightning, USDT, USDC, or USDCE.
POST /api/deposit/asset
Create a deposit that converts BRL to the specified crypto asset and sends it to the provided address.
Request
curl --request POST \
--url https://api.hodle.com.br/api/deposit/asset \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"value": 5000,
"address": "lnbc500u1pj...",
"asset": "LIGHTNING",
"externalId": "my-order-123"
}'const res = await fetch('https://api.hodle.com.br/api/deposit/asset', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.HODLE_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
value: 5000,
address: 'lnbc500u1pj...',
asset: 'LIGHTNING',
externalId: 'my-order-123',
}),
})
const data = await res.json()import os, requests
res = requests.post(
"https://api.hodle.com.br/api/deposit/asset",
headers={
"Authorization": f"Bearer {os.environ['HODLE_API_KEY']}",
"Content-Type": "application/json",
},
json={
"value": 5000,
"address": "lnbc500u1pj...",
"asset": "LIGHTNING",
"externalId": "my-order-123",
},
)
data = res.json()Body example
{
"value": 5000,
"address": "lnbc500u1pj...",
"asset": "LIGHTNING",
"externalId": "my-order-123"
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
value | integer | Yes | Amount in BRL cents. Must be a positive integer. |
address | string | Yes | Destination address. Lightning invoice or LNURL email for LIGHTNING, EVM address for USDT, USDC, and USDCE. |
asset | string | Yes | Asset type: LIGHTNING, USDT, USDC, or USDCE. |
network | string | Cond. | On-chain network for the asset. Required for USDT, USDC, and USDCE. Not needed for LIGHTNING. See Assets & Networks. |
externalId | string | No | Your own ID for reconciliation. Must be unique per deposit (idempotency key). A UUID is generated if not provided. |
subAccountId | string | No | Create the deposit on behalf of this subaccount (scoped to your API key). Defaults to the main account. |
Assets & Networks
| Asset | Networks | Address format |
|---|---|---|
LIGHTNING | lightning | Lightning invoice or LNURL email |
USDT | polygon, arbitrum | EVM address (0x...) |
USDC | polygon, base, gnosis | EVM address (0x...) |
USDCE | gnosis | EVM address (0x...) |
Available networks per asset can depend on your account configuration and KYC level.
Address Formats
For LIGHTNING assets, the address can be:
- A Lightning invoice starting with
lnbc,lntb, orlnbcrt - An LNURL email in the format
user@domain.com
For USDT, USDC, and USDCE assets, the address is an EVM address (0x...) on the selected network.
Response
{
"success": true,
"externalId": "my-order-123",
"qrCode": "lnbc500u1pj...",
"fee": 100,
"fxRateAtTx": 408000.50,
"walletCharge": "charge_abc123"
}Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the deposit was created. |
externalId | string | The external ID for reconciliation (your value or auto-generated UUID). |
qrCode | string | null | QR code for the deposit. |
fee | number | Fee charged for the deposit. |
fxRateAtTx | number | BTC/BRL exchange rate at the time of transaction. |
walletCharge | string | null | Wallet charge identifier. |
Errors
{
"success": false,
"error": "Validation failed",
"details": [
{ "field": "value", "message": "Expected number, received string" }
]
}{
"success": false,
"error": "A deposit with this externalId already exists"
}