Skip to main content

Transfer Between Wallets

Transfer assets between wallets.

Endpoint

POST /api/v3/fermata/wallet/transfer

Description

Transfers assets between wallets owned by the same user under the same dealer. This is a double-entry transaction recorded in the Formance Ledger.

Authentication

Requires Bearer token authentication.

Authorization: Bearer {access_token}

Request Body

FieldTypeRequiredDescription
sourceWalletIdstringYesSource wallet ID
destWalletIdstringYesDestination wallet ID
assetstringYesAsset to transfer (e.g., USDT)
amountstringYesAmount to transfer (decimal string, must be positive)

Response

Returns a simple success response.

Usage

import requests

headers = {"Authorization": f"Bearer {access_token}"}

response = requests.post(
"https://cadenza-api.algo724.com/api/v3/fermata/wallet/transfer",
headers=headers,
json={
"sourceWalletId": "880e8400-e29b-41d4-a716-446655440000",
"destWalletId": "990e8400-e29b-41d4-a716-446655440001",
"asset": "USDT",
"amount": "5000.00"
}
)

print(response.json())
curl -X POST https://cadenza-api.algo724.com/api/v3/fermata/wallet/transfer \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"sourceWalletId": "880e8400-e29b-41d4-a716-446655440000",
"destWalletId": "990e8400-e29b-41d4-a716-446655440001",
"asset": "USDT",
"amount": "5000.00"
}'

Example Response

{
"data": "ok",
"success": true,
"errno": 0,
"error": null
}

Error Responses

HTTP CodeErrorDescription
400Invalid requestMissing parameters, insufficient balance, or same wallet
401UnauthorizedInvalid or expired access token
403ForbiddenWallets not owned by caller
404Not foundWallet not found

Example Error

{
"data": null,
"success": false,
"errno": -140004,
"error": "Insufficient available balance: 3000.00 USDT < 5000.00 USDT"
}

Notes

  • Both wallets must be owned by the same user
  • Both wallets must be ACTIVE
  • Source wallet must have sufficient available balance
  • The transfer is atomic and recorded as a TRANSFER transaction in the ledger