Resend Webhook

This endpoint allows you to resend a webhook to your server

POST https://api.onramp.money/onramp/api/v1/merchant/resendWebhook

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

orderId*

String

Order id of the order for which webhook is to be sent

{ status: 1, code: 200, data: 'Response received from your server' }
var CryptoJS = require('crypto-js');
var axios = require('axios');
async function main() {
  try {
    let body = {
      orderId: 123
    }
    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/resendWebhook',
      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();
// headers received in webhook
{
   "x-onramp-payload": "SOME_VALUE",
   "x-onramp-signature": "SOME_SIGNATURE"
}

// data received in webhook
{
   "orderId":9,
   "walletAddress":"0x12345678900987654321",
   "coinId":54,
   "fiatType":1,
   "expectedPrice":87,
   "fiatAmount":100,
   "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":"0x61refuyiasfdvisuaogdhsaidur35624324",
   "merchantRecognitionId":'13422'
}

Last updated