Przejdź do głównej zawartości

Create Withdrawal

POST
/withdrawal/

Create a cryptocurrency withdrawal request to send funds from your merchant balance to an external address.

Authentication

Requires OAuth 2.0 authentication with read and write scopes.

Request Body

ParameterTypeRequiredDescription
amountdecimalConditionalCrypto amount to withdraw. Either amount or price_amount is required, but not both
price_amountdecimalConditionalFiat amount for conversion. Either amount or price_amount is required, but not both
price_currencystringNoFiat currency for price_amount conversion. Default: "USD"
final_amountbooleanNoIf true, amount is what the recipient receives (fee deducted separately). Default: false
addressstringYesDestination wallet address. Max 255 characters
currencystringConditionalCombined currency code (e.g., "USDTTRC20", "USDTERC20"). Either currency or blockchain + token must be provided
blockchainstringConditionalBlockchain network (e.g., "TRON", "ETH"). Use with token instead of currency
tokenstringConditionalToken symbol (e.g., "USDT"). Use with blockchain instead of currency
memostringNoMemo or tag for the transaction. Max 255 characters. Required for some blockchains (e.g., XRP, XLM)
custom_idstringNoYour internal reference ID. Max 64 characters
callback_urlURLNoURL for webhook notifications about withdrawal status
account_idstringNoWallet account ID. Max 255 characters. If not provided, uses default wallet

Currency Specification

You can specify the withdrawal currency in two ways:

  1. Single currency field: Use a combined code like "USDTTRC20"
  2. blockchain + token: Use separate fields, e.g., "blockchain": "TRON" and "token": "USDT"

Example Request

curl -X POST {{BASE_URL}}/withdrawal/ \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"amount": "100.00",
"currency": "USDTTRC20",
"address": "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL",
"custom_id": "WITHDRAW-12345",
"callback_url": "https://your-site.com/webhook/withdrawal"
}'

Using blockchain + token

curl -X POST {{BASE_URL}}/withdrawal/ \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"amount": "100.00",
"blockchain": "TRON",
"token": "USDT",
"address": "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL",
"custom_id": "WITHDRAW-12345"
}'

Using price_amount (fiat conversion)

curl -X POST {{BASE_URL}}/withdrawal/ \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"price_amount": "50.00",
"price_currency": "USD",
"currency": "USDTTRC20",
"address": "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL"
}'

Response

Success Response (201 Created)

{
"withdrawal_id": "660e8400-e29b-41d4-a716-446655440000",
"custom_id": "WITHDRAW-12345",
"amount": "100.00000000",
"requested_amount": "100.00000000",
"fee": "1.50000000",
"platform_fee": "1.00000000",
"network_fee": "0.50000000",
"blockchain": "TRX",
"token": "USDT",
"currency": "USDTTRC20",
"address": "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL",
"memo": null,
"status": "pending",
"transaction_hash": null,
"confirmations": 0,
"required_confirmations": 20,
"batch_id": null,
"callback_url": "https://your-site.com/webhook/withdrawal",
"created_at": "2025-01-15T12:00:00Z",
"updated_at": "2025-01-15T12:00:00Z",
"completed_at": null
}

Response Fields

FieldTypeDescription
withdrawal_idstringUnique withdrawal identifier
custom_idstringYour custom reference ID, if provided
amountstringWithdrawal amount (what recipient receives)
requested_amountstringOriginally requested amount
feestringTotal fee (platform + network)
platform_feestringPlatform processing fee
network_feestringBlockchain network fee
blockchainstringBlockchain network used
tokenstringToken being withdrawn
currencystringCombined currency code
addressstringDestination wallet address
memostringMemo or tag, if provided
statusstringCurrent withdrawal status
transaction_hashstringBlockchain transaction hash (null until processed)
confirmationsintegerNumber of blockchain confirmations
required_confirmationsintegerRequired confirmations for completion
batch_idstringWithdrawal batch ID, if part of a batch
callback_urlstringWebhook callback URL
created_atstringISO 8601 timestamp of creation
updated_atstringISO 8601 timestamp of last update
completed_atstringISO 8601 timestamp of completion (null until completed)

Error Responses

400 Bad Request - Invalid Address

{
"error": {
"code": "invalid_address",
"message": "Invalid address format",
"details": {
"address": "invalid_address"
}
}
}

400 Bad Request - Insufficient Balance

{
"error": {
"code": "insufficient_balance",
"message": "Insufficient balance for withdrawal",
"details": {
"available": "50.00",
"requested": "100.00",
"currency": "USDTTRC20"
}
}
}

400 Bad Request - Amount Conflict

{
"error": {
"code": "invalid_request",
"message": "Provide either amount or price_amount, not both",
"details": {}
}
}

Withdrawal Status Values

StatusDescription
pendingWithdrawal created, awaiting processing
processingBeing processed by the system
completedSuccessfully sent to blockchain
failedWithdrawal failed; funds returned to balance
cancelledCancelled; funds returned to balance

Fee Structure

Withdrawals incur two types of fees:

  1. Network Fee: Variable blockchain gas fee (changes based on network congestion)
  2. Platform Fee: Platform processing fee

Important Notes

  • Provide either amount (crypto) or price_amount (fiat), not both
  • Provide either currency or blockchain + token, not both
  • When final_amount is true, the specified amount is what the recipient gets; fees are added on top
  • Network fees are estimated and may vary slightly
  • Always verify the destination address - transactions cannot be reversed
  • Implement webhook handlers for real-time status updates

Next Steps