Quick Integration Guide

For developers to automatePayment Link actions

When creating a Payment Link:

  • Go to Step 3: Advanced >> Select Webhook

  • Paste your backend URL (e.g., https://yourdomain.com/webhook)

  • Choose which events you want to receive

βœ… Step 2: Verify Signature of Incoming Webhook Request

When a payment occurred, Paymento sends a POST request to your endpoint with:

  • Content-Type: application/json

  • x-signature: <HMAC signature>

To secure your endpoint:

  • Get your webhook secretkey from Paymento settings

  • Generate HMAC-SHA256 hash of the raw body

  • Compare it to the x-signature header

Node.js Example:

const crypto = require('crypto');

const signature = req.headers['x-paymento-signature'];
const secretKey = 'YOUR_MERCHANT_SECRET_KEY'; // From Paymento dashboard

const computed = crypto
  .createHmac('sha256', secretKey)
  .update(req.rawBody)
  .digest('hex');

if (signature !== computed) {
  return res.status(401).send('Invalid signature');
}

βœ… Step 3: Handle Events

Use Events to Automate Logic

Example use cases:

  • payment_link.paid: Subscribe user to your service

  • subscription.renewed: Extend subscription

  • subscription.grace_expired: Revoke access

  • payment_link.failed: Alert user or retry flow

Node.js Example:

Checklist βœ…

Before going live, Make sure:

Headers Reference

Body Structure

πŸ” Available Events

Event
Description

payment_link.paid

Payment completed

payment_link.failed

Payment failed

payment_link.expired

Link expired without payment

subscription.renewed

Subscription renewed by user

subscription.reminder_sent

Reminder sent (email or Telegram)

subscription.grace_expired

User did not pay, grace ended

Signature Verification (Code Samples)

Node.js

Python

PHP

C#

Ruby

Go

Java

Last updated