Send Dummy Webhook
This endpoint allows you to send a dummy webhook to your server
POST
https://api.onramp.money/onramp/api/v1/merchant/sendDummyWebhook
Headers
Name | Type | Description |
---|---|---|
X-ONRAMP-SIGNATURE* | String | Your api key |
X-ONRAMP-PAYLOAD* | String | payload generated for the request |
X-ONRAMP-APIKEY* | String | signature generated for the request |
Request Body
Name | Type | Description |
---|---|---|
webhookUrl | String | Url to which you wish to receive dummy transaction details If parameter is not sent. The url currently set for your appId will be used. |
{
"status":1,
"code":200,
"data":"Sent webhook"
}
var CryptoJS = require('crypto-js');
var axios = require('axios');
async function main() {
try {
let body = {
webhookUrl: 'http://yourWebsite.com/webhook'
}
let payload = {
timestamp: new Date().getTime(),
body
}
let apiKey = 'API_KEY', apiSecret = 'API_SECRET';
payload = Buffer.from(JSON.stringify(payload)).toString('base64');
let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, apiSecret));
let options = {
url: 'https://api.onramp.money/onramp/api/v1/merchant/sendDummyWebhook',
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
'X-ONRAMP-SIGNATURE': signature,
'X-ONRAMP-APIKEY': apiKey,
'X-ONRAMP-PAYLOAD': payload
},
data: body
};
let data = await axios(options)
console.log(data?.data);
} catch (error) {
console.log(error?.response?.data)
}
}
main();
import json
import time
import base64
import hmac
import hashlib
import requests
def send_dummy_webhook():
try:
body = {
'webhookUrl': 'http://yourWebsite.com/webhook'
}
payload = {
"timestamp": int(time.time() * 1000), # to get timestamp in milliseconds
"body": body
}
api_key = 'API_KEY'
api_secret = 'API_SECRET'
payload = base64.b64encode(json.dumps(payload).encode()).decode()
signature = hmac.new(api_secret.encode(), payload.encode(), hashlib.sha512).hexdigest()
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
'X-ONRAMP-SIGNATURE': signature,
'X-ONRAMP-APIKEY': api_key,
'X-ONRAMP-PAYLOAD': payload
}
url = 'https://api.onramp.money/onramp/api/v1/merchant/sendDummyWebhook'
response = requests.post(url, headers=headers, data=json.dumps(body))
print(response.json())
except Exception as e:
print(str(e))
send_dummy_webhook()
Response from Endpoint
{
"status":1,
"code":200,
"data":"Sent webhook"
}
Response from webhook
{
"orderId":9,
"walletAddress":"0x638E25137871...aAF9d807Ea0d138",
"coinId":54,
"fiatType":1,
"expectedPrice":87,
"fiatAmount":100,
"paymentType": 1
"expectedCryptoAmount":0.89,
"actualPrice":87,
"actualCryptoAmount":0.88,
"kycNeeded": 0,
"createdAt":"2022-10-08T06:25:17.000Z",
"updatedAt":"2022-11-09T16:58:07.000Z",
"status":4,
"referenceId":"227912121212",
"chainId":3,
"onRampFee":2.49,
"gasFee":0.25,
"clientFee":2.49,
"gatewayFee":2.5,
"transactionHash":"0x5999ce9ae014a58f23c2886...f0a5e69ea7c92461e2bb4c9226e",
"merchantRecognitionId":'13422',
"webhookTrials": 0
}
orderId -> order id of the transaction
walletAddress -> Onchain wallet address to which the crypto was withdrawn to.
coinId -> Id of the coin (e.g. 54 denotes to USDT)
fiatType -> fiat type used for the transaction
1 -> Indian Rupee (INR)
2 -> Turkish lira (TRY)
3 -> Arab Emirates Dirham (AED)
4 -> Mexican Peso (MXN)
paymentType -> payment method in fiat
1 -> Instant transfer (e.g. UPI)
2 -> Bank transfer (e.g. IMPS/FAST)
expectedCryptoAmount -> amount of crypto estimate shown at the beginning of the transaction
expectedPrice -> expected price estimate shown at the beginning of the transaction
createdAt -> time at which the transaction was created.
appId -> App Id of the merchant/Partner.
status -> denotes the status of the order
-4 -> wrong amount sent
-3 -> bank and kyc name mismatch
-2 -> transaction abandoned
-1 -> transaction timed out
0 -> transaction created
1 -> referenceId claimed
2 -> deposit secured
3, 13 -> crypto purchased
4, 15 -> withdrawal complete
5, 16 -> webhook sent
11 -> order placement initiated
12 -> purchasing crypto
14 -> withdrawal initiated
chainId -> denotes which chain the coin was sent on (e.g. 3 denotes MATIC20)
onRampFee -> fee charged by onramp in pct
clientFee -> fee charged by client
gatewayFee -> fee charged by gateway
gasFee -> Onchain transaction fee charged
actualCryptoAmount -> actual amount of crypto bought at the time of swap/trade.
actualPrice -> actual price at time of swap/trade.
transactionHash -> hash id of the transaction sent onchain.
referenceId -> Reference Id entered by the user after completing fiat payment.
kycNeeded -> KYC status of the user
0 -> basic KYC, no additional information required
1 -> KYC needed to process this transaction
merchantRecognitionId -> Specific string that can be passed by the merchant/Partner at the time of making the request.
webhookTrials -> The number of attempts made to reach the intended endpoint using a webhook.
Last updated