JWT Webhooks

For enhanced security, Juspay provides JWT encryption support for webhooks. Merchants already familiar with JWT for API calls can now opt for the feature to encrypt call backs also.

Webhook Payload

Webhook payload can be signed then encrypted to provide confidentiality and integrity. Signed and encrypted payload will be of below format

For a detailed list of webhook events and sample decrypted payload please refer here. link icon

You can also refer to the sample code to see how to decrypt JWT payload

Enable JWT webhooks from the Dashboard

You can enable JWT encryption for webhooks through the dashboard in the settings module under the webhooks tab.

Warning

If you are planning to migrate from the existing auth method to JWT and JWT webhooks, please ensure backwards compatibility of webhooks. Once JWT webhooks is enabled and is activated we will start encrypting the webhooks.

Steps to enable JWT encryption from the dashboard -

  1. Find Webhook Encryption Key selector under the webhook settings tab (Payments → Settings → Webhooks)

  1. Choose the UUID of the JWT key you plan to use for encrypting webhooks

  1. Click the Update Webhook Settings button to confirm your selection

Key Rotation

For security purposes, it is advisable to rotate your API keys at least every 90 days. To update the JWT key used for webhook encryption from the dashboard, please follow these steps:

  1. In the Webhook Encryption Key selector (Payments → Settings → Webhooks), select the UUID of the new key intended for webhook encryption

  1. Click the Update Webhook Settings button to confirm your selection

Last updated 1 year ago