Generate New Payment
This endpoint generates a new payment request (including deposit address) for a specific wallet and cryptocurrency.
Request
POST /wallets/payment
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
wallet_id | string | Yes | The ID of the wallet to generate payment for |
currency | string | Yes | The currency code for the payment (e.g., "USDTTRC20", "BTC") |
amount | string | No | The amount expected in the payment |
is_fixed_rate | boolean | No | If true, fixes the exchange rate at the time of generation |
is_fee_paid_by_user | boolean | No | If true, the user pays the transaction fee |
callback_url | string | No | URL to receive asynchronous payment notifications |
Authentication
This endpoint requires authentication using one of the following methods:
- API Key:
X-API-Keyheader - OAuth 2.0:
Authorization: Bearer {access_token}header
Example Request
curl -X POST "https://api.cryptofuse.io/wallets/payment" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"wallet_id": "0d773ede-3a32-454e-8554-13f37eaa2f2a",
"currency": "eth",
"amount": "0.1",
"is_fixed_rate": true,
"is_fee_paid_by_user": false,
"callback_url": "https://yourdomain.com/wallets/callback/"
}'
Response
A successful response returns the details of the newly created payment, including the deposit address.
Example Response
{
"address": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"wallet_id": "550e8400-e29b-41d4-a716-446655440000",
"wallet_name": "Trading Wallet",
"currency": "USDTTRC20",
"address": "TYN2WuEqttM5JjGk4ynGkxcnMRR9SZcvVx",
"created_at": "2025-04-30T12:34:56.789Z"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
address.id | string | Unique identifier for the payment address |
address.wallet_id | string | ID of the wallet |
address.wallet_name | string | Name of the wallet |
address.currency | string | Payment currency |
address.address | string | Blockchain deposit address |
address.created_at | string | ISO 8601 timestamp of payment creation |
Error Responses
| Status Code | Error Code | Description |
|---|---|---|
| 400 | invalid_request | Invalid request or missing parameters |
| 401 | unauthorized | Authentication failed |
| 403 | forbidden | User lacks required permissions |
| 404 | wallet_not_found | Wallet not found |
| 422 | currency_invalid | Invalid or unsupported currency |
| 500 | server_error | Internal server error |
Notes
- Wallet ID must be valid and previously created.
- This endpoint is used to initiate a payment and return an address for it.
- Multiple payments can be generated for the same wallet and currency.
- Some blockchains may require additional fields (e.g.,
memo,tag).