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
| Parameter | Type | Required | Description |
|---|---|---|---|
| wallet_id | string | Yes | The external ID of the user wallet (sub-account) to process payment from |
| currency | string | Yes | The currency code (e.g., "USDTTRC20", "BTC") |
| amount | number | Yes | The amount to pay (must be positive) |
| is_fixed_rate | boolean | No | Whether to use a fixed exchange rate (default: false) |
| is_fee_paid_by_user | boolean | No | Whether the user pays the transaction fee (default: false) |
| callback_url | string | No | URL 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
| Parameter | Type | Description |
|---|---|---|
| result | object | Result object containing payment details |
Result Object
| Parameter | Type | Description |
|---|---|---|
| payment_id | string | Unique payment identifier |
| payment_status | string | Current payment status (e.g. "waiting", "confirmed") |
| pay_address | string | Cryptocurrency address for payment |
| price_amount | number | Amount in fiat currency |
| price_currency | string | Fiat currency code (e.g. "usd") |
| pay_amount | number | Amount to pay in cryptocurrency |
| amount_received | number | Already received amount (for partial payments) |
| pay_currency | string | Cryptocurrency code (e.g. "USDTTRC20") |
| order_id | string | Internal order identifier |
| order_description | string | Description of payment purpose |
| callback_url | string | URL for payment status notifications |
| created_at | string | Payment creation timestamp (ISO 8601) |
| updated_at | string | Last payment update timestamp (ISO 8601) |
| purchase_id | string | Unique identifier for purchase transaction |
| network | string | Blockchain network (e.g. "tron") |
| expiration_estimate_date | string | Estimated payment expiration time (ISO 8601) |
| valid_until | string | Payment validity deadline (ISO 8601) |
| type | string | Transaction 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 Code | Error Message | Description |
|---|---|---|
| 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 |
| 401 | authentication_failed | Authentication failed. Check your API key or OAuth 2.0 access token |
| 403 | insufficient_permissions | Your 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.