Skip to main content

webhook

A lightweight, reliable service for creating and managing webhooks to connect your applications.

What is a Webhook?

Webhooks create an effective, event-driven communication system by automatically pushing data to your application when certain events take place, in contrast to traditional APIs where your program must request information.

Getting Started

Prerequisites

  • Active account with our service
  • Application with a publicly accessible HTTPS endpoint
  • Administrator privileges on your account

Creating a Webhook

  1. Login to Dashboard

  2. Access Webhook Configuration

    • Navigate to the webhook settings page using the links above
  3. Create New Webhook

    • Click the "+ New Webhook" button
    • Provide a descriptive name for your webhook

Security Best Practices

  • Validate webhook signatures using your secret key, we send our request with x-longswipe-signature in the header request, with a sha512 encryption
  • Each webhook set up has a secret key which can be found in your webhook area of your dashboard
  • Implement proper error handling
  • Set up monitoring for webhook delivery status
  • Use HTTPS for all webhook endpoints

Verifying Webhook Signatures

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
const hmac = crypto.createHmac('sha512', secret);
const calculatedSignature = hmac.update(payload).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(calculatedSignature, 'hex'),
Buffer.from(signature, 'hex')
);
}

Example Implementation

Example Webhook Payload

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"resolved": true,
"event": "VOUCHER_REDEEMED",
"retryAttempt": 0,
"status": "delivered",
"metaData": "{\"ip\":\"192.168.1.1\",\"userAgent\":\"Mozilla/5.0\",\"location\":\"New York\"}",
"referenceId": "TRX-12345-67890",
"transaction": {
"id": "123e4567-e89b-12d3-a456-426614174001",
"referenceId": "INV-2025-03-26-001",
"amount": 125.5,
"title": "Voucher redemption",
"chargedAmount": 128.75,
"chargeType": "debit",
"type": "subscription",
"status": "completed",
"createdAt": "2025-03-26T10:30:45Z",
"updatedAt": "2025-03-26T10:32:15Z",
"currency": {
"id": "123e4567-e89b-12d3-a456-426614174003",
"image": "https://assets.example.com/currencies/usd.png",
"name": "United States Dollar",
"symbol": "$",
"abbreviation": "USD",
"currencyType": "fiat",
"isActive": true,
"createdAt": "2024-01-01T00:00:00Z"
},
"transactionHash": "0x3a2b1c0d3a2b1c0d3a2b1c0d3a2b1c0d3a2b1c0d3a2b1c0d3a2b1c0d3a2b1c0d",
"referenceHash": "0xe7f6g5h4e7f6g5h4e7f6g5h4e7f6g5h4e7f6g5h4e7f6g5h4e7f6g5h4e7f6g5h4",
"metaData": "{\"note\":\"Regular payment\",\"category\":\"recurring\",\"tags\":[\"subscription\",\"monthly\"]}"
}
}

Troubleshooting

  • Verify your endpoint is publicly accessible
  • Check logs for delivery attempts and responses
  • Ensure your server responds with 2xx status codes
  • Contact support if webhook events are consistently failing

Support

If you encounter any issues or have questions, please contact our support team: