Initiate Transaction (External Withdraw)
Initiate a Buy Transaction API Guide
This API is used to initiate a buy transaction for converting fiat currency into cryptocurrency. This endpoint initiated transaction where the desired cryptocurrency is withdrawn to an external wallet specified by the user/merchant.
Endpoint
https://mudrex.com/api/v1/wallet/crypto/buy/
Sample Request
curl --location 'https://mudrex.com/api/v1/wallet/crypto/buy/' \
--header 'X-Timestamp: {{timestamp}}' \
--header 'X-Client-Id: •••••••' \
--header 'X-Request-Id: qsfe' \
--header 'X-User-Id: •••••••' \
--header 'X-Secret-Key: •••••••' \
--data '{
"from_currency": "INR",
"to_currency": "USDT",
"to_amount": 10,
"source_id": "c41f7d27-781c-41da-b74c-278fe7202af5",
"payment_method": "bank_transfer",
"crypto_wallet_address": "0xb84b44140b9c9d2a32707ba35332969c65bc918d",
"network": "BSC"
}'
{
"success": true,
"data": {
"fiat_symbol": "INR",
"crypto_amount": 10,
"source_id": "c41f7d27-781c-41da-b74c-278fe7202af5",
"id": "74cbe2f9-4e2a-4bd2-92d2-1a139e7cdcf9",
"crypto_symbol": "USDT",
"crypto_wallet_address": "0xb84b44140b9c9d2a32707ba35332969c65bc918d",
"network": "BSC",
"failure_desc": null,
"created_at": 1684394172000,
"bank_transaction_id": null,
"fiat_amount": 976.11,
"status": "PROCESSING",
"payment_method": "bank_transfer",
"failure_code": null,
"exchange_rate": 97.61,
"tag": null
}
}
Required Parameters
Parameter | Type | Description |
---|---|---|
from_currency | string | The fiat currency symbol. Supported values: INR , EUR , GBP . |
to_currency | string | The cryptocurrency symbol. Currently supported: USDT (other tokens supported on request). |
crypto_wallet_address | string | The destination crypto wallet address where the purchased crypto will be sent. |
from_amount or to_amount | number | Specify either the amount of fiat to convert (from_amount ) or the desired crypto amount (to_amount ). |
network | string | The blockchain network. Example: BSC (Binance Smart Chain). |
Optional Parameters
Parameter | Type | Description |
---|---|---|
source_id | string | IBAN of sender in case of "sepa_transfer" payment method |
bank_transaction_id | string | UTR of transaction in case of "upi_transfer" and "bank_transfer" "IBAN_Transaction-Reference" in case of "sepa_transfer" |
payment_method | string | The payment method to be used. Example: bank_transfer . |
id | string | Merchant's custom transaction ID. If provided, this will be used as the transaction identifier. |
tag | string | Additional metadata or tags to associate with the transaction for tracking or categorization. |
Response Details
Item | Type | Description |
---|---|---|
success | boolean | Indicates whether the API call was successful or not. |
fiat_symbol | string | The symbol of the fiat currency used in the transaction (e.g., INR , EUR , GBP ). |
crypto_amount | number | The amount of cryptocurrency purchased. |
source_id | string | |
id | string | The unique identifier for the transaction generated by the system. |
crypto_symbol | string | The symbol of the cryptocurrency purchased (e.g., USDT ). |
crypto_wallet_address | string | The wallet address where the purchased cryptocurrency will be sent. |
network | string | The blockchain network used for the transaction (e.g., BSC ). |
failure_desc | string | A description of the failure if the transaction was unsuccessful. |
created_at | number | The timestamp when the transaction was created, in milliseconds since the Unix epoch. |
bank_transaction_id | string | The identifier for the bank transaction, if applicable. |
fiat_amount | number | The amount of fiat currency used in the transaction. |
status | string | The status of the transaction (e.g., PROCESSING , SUCCESS , FAILED ). |
payment_method | string | The payment method used for the transaction (e.g., bank_transfer ). |
failure_code | string | A code indicating the reason for failure, if applicable. |
exchange_rate | number | The exchange rate applied for the transaction. |
tag | string | Any metadata or tags associated with the transaction, as provided in the request. |
Key Notes
- Merchants can pass their custom transaction ID using the source_id parameter, enabling tracking and reference on their systems.
- Supported fiat currencies: INR, EUR, GBP.
- Supported Cryptocurrency: USDT. Additional tokens are available upon request.
- The network parameter must specify the blockchain network used for the transaction.
Check more details about API endpoint here.
Updated 26 days ago