Skip to main content

Withdraw from User Wallet

Withdraw funds from a user's custodial wallet to an external address. This endpoint is only available when custody is managed externally (not by the system).

Endpoint

POST /v2/users/users/{user_id}/withdraw

Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer {token}

Path Parameters

ParameterTypeRequiredDescription
user_idstringYesThe unique identifier of the user

Request Body

{
"address": "0x...",
"amount": 100.5,
"currency_token_id": "6913307ec95e268b239b2d8b"
}

Parameters

ParameterTypeRequiredDescription
addressstringYesDestination wallet address for the withdrawal
amountnumberYesAmount to withdraw
currency_token_idstringNoCurrency token ID for token withdrawals. Omit for native token withdrawal

Example

Request

curl --location 'https://test-integration-api.tokenizationtr.com/v2/users/users/6913872755654191dede37da/withdraw' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data '{
"address": "0x4A096E485281DE1B8bF11A511D39d5B128EF7C4b",
"amount": 10.5
}'

Response

Returns a transaction ID for async processing. A user transaction row is created with type = 10 (Withdraw) and status = 1 (Started). The wallet pipeline then moves it to InProgressDone (or Error).

{
"transaction_id": "6913872755654191dede37da"
}

Poll Get User Transactions — filter by types=10 if you only care about withdrawals — and watch the matching id until its status is 3 (Done) or 4 (Error). The transaction's hash field is populated once the wallet broadcasts on-chain.

Response Fields

FieldTypeDescription
transaction_idstringTransaction ID for polling - use to check withdrawal status

Error Responses

400 Bad Request

{
"error": "Invalid parameters",
"details": "Address and amount are required"
}

401 Unauthorized

{
"error": "Authentication required"
}

403 Forbidden

{
"error": "Access denied"
}

404 Not Found

{
"error": "User not found"
}

409 Conflict

Returned when custody is managed by the system (withdraw not available):

{
"error": "withdraw is only available when custody is managed externally"
}

500 Internal Server Error

{
"error": "Internal server error"
}

Important Notes

  • Custody Requirement: Withdraw is only available when custody is managed externally. When the system manages custody, the API returns 409 Conflict.
  • Async Processing: Withdrawal is processed asynchronously; use transaction_id to poll the Get User Transactions endpoint for status updates.
  • Native vs Token: Omit currency_token_id for native token withdrawals. Provide currency_token_id for ERC-20 or other currency token withdrawals.
  • User Wallet: The user must have a wallet address set before withdrawing.