πŸ“ƒWebhook Integration

Overview

The PayLater arrow-up-rightsystem sends real-time webhook notifications to your backend when key events occur, such as transaction status updates. This ensures your platform stays in sync with the latest PayLater arrow-up-rightevents.

⚠️ Important: To activate webhooks, merchants must share their Webhook Endpoint URL with PayLaterarrow-up-right and request their unique Webhook Secret from their account manager.

πŸ“₯ Webhook Request

Webhook events are delivered as an HTTP POST request with a JSON payload.

Endpoint

You must expose a public POST endpoint to receive these requests.

Headers

  • Content-Type: application/json

Request Body

{
  "merchantId": "<merchant_id>",
  "orderId": "<order_id>",
  "paylaterRef": "PL1746499849330726",
  "status": "<status>",
  "timestamp": "<timestamp>",
  "signature": "<signature>",
  "txHash": "<tx_hash>",
  "comments": "<comments>"
}

Parameter Descriptions

Field

Type

Description

merchantId

String

Unique identifier for the merchant

orderId

String

Unique identifier for the order

status

String

Status of the order (e.g., success, failed, pending)

timestamp

Long

Epoch timestamp of the request

signature

String

HMAC SHA-256 signature generated using txHash and the webhook secret

txHash

String

MD5 hash of the concatenated payload (merchantId + orderId + orderstatus + timestamp + comments)

comments

String

Optional comments or metadata

πŸ” Security & Validation

To validate the webhook and ensure it's sent by PayLater:

  1. Reconstruct the Data String:

    • Concatenate merchantId + orderId + status + timestamp + comments

    • Convert the whole string to uppercase

    • Generate an MD5 hash of this string and compare it with the provided txHash

  2. Validate Signature:

    • Use HMAC SHA-256 with your merchantWebhookSecret

    • Hash the txHash value

    • Compare the result with the signature field from the request

βœ… Sample Node.js Verification

βœ… Sample PHP Verification


Last updated