curl --request POST \
--url https://production.hifibridge.com/v2/wallets/swaps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"source": {
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"chain": "POLYGON",
"currency": "usdt",
"amount": "10000"
},
"destination": {
"chain": "POLYGON",
"currency": "usdc",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": "64fc4e9d-4839-4384-b4a0-0376af2c9b2e",
"walletAddress": "0xE9cfBf1D690565579D823264170eE357f80e9A34",
"amount": "10000"
}
}
'{
"transferType": "WALLET.SWAP",
"transferDetails": {
"id": "dc923cc1-d74b-58f6-9fe4-9e9c6eb8dc37",
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"status": "COMPLETED",
"createdAt": "2025-08-20T03:55:29.437108+00:00",
"updatedAt": "2025-08-20T04:08:10.837+00:00",
"source": {
"currency": "usdc",
"amount": 10,
"chain": "POLYGON",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6"
},
"destination": {
"currency": "usdt",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": null,
"amount": null,
"chain": "POLYGON",
"walletAddress": "0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204"
},
"error": null,
"errorDetails": null,
"quoteInformation": {
"sendGross": {
"amount": "10",
"currency": "usdc"
},
"sendNet": {
"amount": "10",
"currency": "usdc"
},
"receiveGross": {
"amount": "10",
"currency": "usdc"
},
"receiveNet": {
"amount": "10",
"currency": "usdc"
},
"rate": "1",
"expiresAt": "2025-08-20T03:55:59.539+00:00"
},
"billingInformation": {
"fees": [
{
"id": "2ca381ec-9498-52f5-9a27-d0e392b2626b",
"amount": 0.01,
"currency": "USD",
"type": "EXCHANGE_FEE",
"timing": "ON_INVOICE"
}
]
}
}
}Create a swap request to exchange one cryptocurrency for another within the same chain.
curl --request POST \
--url https://production.hifibridge.com/v2/wallets/swaps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"source": {
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"chain": "POLYGON",
"currency": "usdt",
"amount": "10000"
},
"destination": {
"chain": "POLYGON",
"currency": "usdc",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": "64fc4e9d-4839-4384-b4a0-0376af2c9b2e",
"walletAddress": "0xE9cfBf1D690565579D823264170eE357f80e9A34",
"amount": "10000"
}
}
'{
"transferType": "WALLET.SWAP",
"transferDetails": {
"id": "dc923cc1-d74b-58f6-9fe4-9e9c6eb8dc37",
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"status": "COMPLETED",
"createdAt": "2025-08-20T03:55:29.437108+00:00",
"updatedAt": "2025-08-20T04:08:10.837+00:00",
"source": {
"currency": "usdc",
"amount": 10,
"chain": "POLYGON",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6"
},
"destination": {
"currency": "usdt",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": null,
"amount": null,
"chain": "POLYGON",
"walletAddress": "0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204"
},
"error": null,
"errorDetails": null,
"quoteInformation": {
"sendGross": {
"amount": "10",
"currency": "usdc"
},
"sendNet": {
"amount": "10",
"currency": "usdc"
},
"receiveGross": {
"amount": "10",
"currency": "usdc"
},
"receiveNet": {
"amount": "10",
"currency": "usdc"
},
"rate": "1",
"expiresAt": "2025-08-20T03:55:59.539+00:00"
},
"billingInformation": {
"fees": [
{
"id": "2ca381ec-9498-52f5-9a27-d0e392b2626b",
"amount": 0.01,
"currency": "USD",
"type": "EXCHANGE_FEE",
"timing": "ON_INVOICE"
}
]
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Unique identifier for the swap request (recommend using uuid v4)
"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86"
Source wallet information for the swap
Show child attributes
User ID of the source wallet owner
"05179f69-1988-4b46-a847-dd4eea0984d6"
Blockchain network for the source wallet
POLYGON, ETHEREUM, SOLANA "POLYGON"
Source cryptocurrency to swap from
usdc, usdt "usdt"
Amount to swap (either source.amount or destination.amount must be provided)
"10000"
Destination wallet information for the swap
Show child attributes
Blockchain network for the destination wallet
POLYGON, ETHEREUM, SOLANA "POLYGON"
Destination cryptocurrency to swap to
usdc, usdt, usdg "usdc"
User ID of the destination wallet owner
"05179f69-1988-4b46-a847-dd4eea0984d6"
External wallet ID (Exclude with userId)
"64fc4e9d-4839-4384-b4a0-0376af2c9b2e"
Wallet address (Exclude with userId)
"0xE9cfBf1D690565579D823264170eE357f80e9A34"
Amount to receive (either source.amount or destination.amount must be provided)
"10000"
Success
"WALLET.SWAP"
Show child attributes
"dc923cc1-d74b-58f6-9fe4-9e9c6eb8dc37"
"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86"
PENDING, COMPLETED, FAILED, CANCELLED "COMPLETED"
"2025-08-20T03:55:29.437108+00:00"
"2025-08-20T04:08:10.837+00:00"
Show child attributes
"usdt"
"05179f69-1988-4b46-a847-dd4eea0984d6"
null
null
"POLYGON"
"0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204"
null
null
Show child attributes
"1"
"2025-08-20T03:55:59.539+00:00"
Show child attributes
Show child attributes
"2ca381ec-9498-52f5-9a27-d0e392b2626b"
0.01
"USD"
EXCHANGE_FEE, GAS_FEE "EXCHANGE_FEE"
ON_INVOICE, ON_TRANSACTION "ON_INVOICE"