Skip to main content

Create Payment from User Wallet

POST
/wallets/payment/

Creates a payment directly from a user wallet (sub-account). This operation decreases the sub-account balance and increases the master account balance by the specified amount, then processes the payment.

Request Parameters

ParameterTypeRequiredDescription
wallet_idstringYesThe external ID of the user wallet (sub-account) to process payment from
currencystringYesThe currency code (e.g., "USDTTRC20", "BTC")
amountnumberYesThe amount to pay (must be positive)
is_fixed_ratebooleanNoWhether to use a fixed exchange rate (default: false)
is_fee_paid_by_userbooleanNoWhether the user pays the transaction fee (default: false)
callback_urlstringNoURL to receive payment status updates via webhook

Example Request

POST /wallets/payment/
Content-Type: application/json
X-API-Key: your_api_key_here

{
"wallet_id": "550e8400-e29b-41d4-a716-446655440000",
"currency": "USDTTRC20",
"amount": 25.00,
"is_fixed_rate": false,
"is_fee_paid_by_user": true,
"callback_url": "https://your-website.com/payment/callback"
}

Response Parameters

ParameterTypeDescription
resultobjectResult object containing payment details

Result Object

ParameterTypeDescription
payment_idstringUnique payment identifier
payment_statusstringCurrent payment status (e.g. "waiting", "confirmed")
pay_addressstringCryptocurrency address for payment
price_amountnumberAmount in fiat currency
price_currencystringFiat currency code (e.g. "usd")
pay_amountnumberAmount to pay in cryptocurrency
amount_receivednumberAlready received amount (for partial payments)
pay_currencystringCryptocurrency code (e.g. "USDTTRC20")
order_idstringInternal order identifier
order_descriptionstringDescription of payment purpose
callback_urlstringURL for payment status notifications
created_atstringPayment creation timestamp (ISO 8601)
updated_atstringLast payment update timestamp (ISO 8601)
purchase_idstringUnique identifier for purchase transaction
networkstringBlockchain network (e.g. "tron")
expiration_estimate_datestringEstimated payment expiration time (ISO 8601)
valid_untilstringPayment validity deadline (ISO 8601)
typestringTransaction type (e.g. "crypto2crypto")

Example Response

{
"result": {
"payment_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"payment_status": "waiting",
"pay_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"price_amount": 75.00,
"price_currency": "usd",
"pay_amount": 75.00,
"amount_received": 0,
"pay_currency": "USDTTRC20",
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"order_description": "Player deposit",
"callback_url": "https://your-site.com/wallet/callback",
"created_at": "2025-05-05T10:49:27.414Z",
"updated_at": "2025-05-05T10:49:27.414Z",
"purchase_id": "e29b41d4-a716-4466-5544-000058cc4372",
"network": "tron",
"expiration_estimate_date": "2025-05-05T11:09:27.418Z",
"valid_until": "2025-05-05T11:09:27.418Z",
"type": "crypto2crypto"
}
}

Error Codes

Status CodeError MessageDescription
400"User ID, currency, and amount are required"Missing required parameters
400"Amount must be positive"Attempting to pay zero or negative amount
400"Insufficient available balance"User wallet has insufficient balance to complete the payment
404"Account not found"The specified account ID does not exist
404"Balance not found"No balance exists for the specified currency in the user wallet
404"Tenant balance not found"No balance exists for the specified currency in the master account
401authentication_failedAuthentication failed. Check your API key or OAuth 2.0 access token
403insufficient_permissionsYour API key does not have required permissions
500"Internal server error"An error occurred on the server

Notes

  • This endpoint is used to process payments directly from a player's wallet.
  • The available balance check ensures that the user has enough funds available for the payment.
  • Specify a callback URL to receive real-time updates about the payment status.
  • The fixed rate option ensures that the payment amount won't fluctuate due to cryptocurrency price changes.

iGaming Integration Note

Casino operators can use this endpoint to process payments directly from player wallets to external parties. This can be used for features like direct transfers to other players, payments to third-party services, or other external transactions that need to be initiated from a player's wallet.