Resend Webhook
This endpoint allows you to resend a webhook to your server
POST
https://api.onramp.money/onramp/api/v1/merchant/resendWebhook
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 |
---|---|---|
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();
import json
import time
import base64
import hmac
import hashlib
import requests
def resend_webhook():
try:
body = {
'orderId': 141
}
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/resendWebhook'
response = requests.post(url, headers=headers, data=json.dumps(body))
print(response.json())
except Exception as e:
print(str(e))
resend_webhook()
// 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'
}
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 -> India (Default) INR
2 -> Turkey (TRY)
3 -> Arab Emirates Dirham (AED)
4 -> Mexican Peso (MXN)
5 -> Vietnamese dong (VND)
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.
Last updated