🔁 Webhook
Overview
Our webhook feature allows users to receive real-time updates for transactions. When an event occurs, the webhook will trigger and send a response with the transaction details.
Webhook Response Structure
When our webhook triggers, it sends a response containing detailed information about the transaction. Here is the structure of the response:
{
"data": {
"order_id": "",
"provider": "",
"walletAddress": "0x...35",
"status": "PROCESSING", // PROCESSING, COMPLETED, FAILED, PENDING
"fiatCurrency": "EUR",
"fiatAmount": 1000,
"cryptoAmount": 0.44343039,
"cryptoCurrency": "ETH",
"network": "ETH",
"transactionHash": "0x...21",
"isBuyOrSell": "BUY" // BUY or SELL
}
}
Setting Up the Webhook
Step 1: Register the Webhook URL
- Navigate to Rampnalysis App.
- Go to Settings > Account Credentials.
- Under the Webhook section, enter the URL where you want to receive the webhook payloads.
Step 2: Catching the Webhook Response
To catch the webhook response, set up a server endpoint that listens for POST
requests. Ensure your server parses JSON:
app.post("/my-webhook-endpoint", (req, res) => {
const webhookPayload = req.body;
console.log("Received webhook:", webhookPayload);
// Process the webhook data
res.status(200).send("Received!");
});
Webhook Security
Your webhook endpoint must be secured using HTTPS.
Validate incoming requests to confirm they’re from legitimate sources.
Troubleshooting
Not Receiving Webhooks?
Ensure the webhook URL is correct and your server is properly receiving and responding to POST
requests.
Invalid Data?
Validate the data structure received and ensure your server is correctly parsing the JSON payload.