post http://{{base_url}}/api/v2/wallet/transaction/crypto/buy
This API endpoint is used to initiate a crypto buy transaction for the user.
It takes the following parameters in the request:
Parameter | Description | Required |
---|---|---|
from_currency | The fiat currency used for onramp (currently supported: INR, EUR, GBP) | Yes |
to_currency | The crypto token to be purchased | Yes |
from_amount | Amount of fiat whose equivalent crypto needs to be purchased | Either this or to_amount |
to_amount | Amount of cryptocurrency to be purchased | Either this or from_amount |
payment_method | Payment method used for making fiat deposit | Yes |
crypto_wallet_address | Wallet address of the user where crypto needs to be deposited | Yes |
network | Blockchain network where the transfer needs to be made (MATIC preferred) | Yes |
source_id | IBAN of sender in case of "sepa_transfer" payment method | Yes, for sepa_transfer Not required for other payment methods |
bank_transaction_id | UTR of transaction in case of "upi_transfer" and "bank_transfer" "IBAN_Transaction-Reference" in case of "sepa_transfer" | Yes, for sepa_transfer , bank_transfer , and upi_transfer Not required for others |
id (optional) | Custom transaction ID provided by the merchant. If not provided, Saber Money will generate one and return it in the response. | Optional |
{
"from_currency": "EUR",
"to_currency": "USDT",
"from_amount": 12,
"payment_method": "open_banking",
"crypto_wallet_address": "0x42882849d99d114462f8da6367ca ...",
"network": "BSC"
}
An additional parameter "id" can be passed if the merchant wants to use their generated id as the transaction id. Otherwise, Saber Money will generate an id for the transaction and pass it in the response.