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

ParameterTypeDescription
from_currencystringThe fiat currency symbol. Supported values: INR, EUR, GBP.
to_currencystringThe cryptocurrency symbol. Currently supported: USDT (other tokens supported on request).
crypto_wallet_addressstringThe destination crypto wallet address where the purchased crypto will be sent.
from_amount or to_amountnumberSpecify either the amount of fiat to convert (from_amount) or the desired crypto amount (to_amount).
networkstringThe blockchain network. Example: BSC (Binance Smart Chain).

Optional Parameters

ParameterTypeDescription
source_idstringIBAN of sender in case of "sepa_transfer" payment method
bank_transaction_idstringUTR of transaction in case of "upi_transfer" and "bank_transfer"

"IBAN_Transaction-Reference" in case of "sepa_transfer"
payment_methodstringThe payment method to be used. Example: bank_transfer.
idstringMerchant's custom transaction ID. If provided, this will be used as the transaction identifier.
tagstringAdditional metadata or tags to associate with the transaction for tracking or categorization.

Response Details

ItemTypeDescription
successbooleanIndicates whether the API call was successful or not.
fiat_symbolstringThe symbol of the fiat currency used in the transaction (e.g., INR, EUR, GBP).
crypto_amountnumberThe amount of cryptocurrency purchased.
source_idstring
idstringThe unique identifier for the transaction generated by the system.
crypto_symbolstringThe symbol of the cryptocurrency purchased (e.g., USDT).
crypto_wallet_addressstringThe wallet address where the purchased cryptocurrency will be sent.
networkstringThe blockchain network used for the transaction (e.g., BSC).
failure_descstringA description of the failure if the transaction was unsuccessful.
created_atnumberThe timestamp when the transaction was created, in milliseconds since the Unix epoch.
bank_transaction_idstringThe identifier for the bank transaction, if applicable.
fiat_amountnumberThe amount of fiat currency used in the transaction.
statusstringThe status of the transaction (e.g., PROCESSING, SUCCESS, FAILED).
payment_methodstringThe payment method used for the transaction (e.g., bank_transfer).
failure_codestringA code indicating the reason for failure, if applicable.
exchange_ratenumberThe exchange rate applied for the transaction.
tagstringAny 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.