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

NameTypeDescription

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

NameTypeDescription

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();

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
}

Last updated