Webhooks Introduction

πŸ”” Webhooks

Webhooks provide a powerful way for your application to receive real-time updates from the PayNow API. Instead of polling for changes, you can subscribe to specific events, and PayNow will send a POST request to your server when those events occur.


βš™οΈ How Webhooks Work

When you subscribe to a webhook event:

  1. You provide a URL endpoint.

  2. PayNow sends a POST request to that URL whenever the subscribed event occurs.

  3. The request body contains relevant event data.

  4. Your server processes this data and returns an appropriate HTTP status.


πŸš€ Setting Up Webhooks

You can configure webhook subscriptions in two ways:

  • Via the Dashboard Use the built-in user interface to manage subscriptions.

  • Via the API Programmatically register webhook endpoints with desired settings.

Required Setup Details

Parameter
Description

event

The event you want to subscribe to

url

The full URL where the POST request should be sent

type

Payload format (see Webhook Types below)


πŸ“¦ Webhook Types

Currently, PayNow supports the following two webhook types:

Type
Format
Description

JSON (v1)

JSON

Sends a structured JSON payload. Fully documented under Webhook Integration

Discord (v1)

Discord Embed

Sends a Discord-friendly embed. Simply plug in a Discord webhook URL and customize the message using templates

⚠️ Only the JSON v1 webhook is covered in the Webhook Integration documentation. The Discord webhook works by copying your Discord webhook URL into PayNow and setting your event and message template.


πŸ“£ Event Types

PayNow supports various event types that can trigger a webhook. For the full list of supported events, refer to the Webhook Events documentation.


πŸ“¬ Handling Webhook Notifications

When your server receives a webhook:

  • It should return a 2xx status code if the event was received and processed successfully.

  • If your server responds with a non-successful status code (>299), PayNow will retry automatically.

Retry Behavior

  • Retries use exponential backoff, meaning delays will increase between attempts.

  • Delivery attempts will continue for a reasonable period before being marked as failed.


πŸ“˜ Further Reading

  • Webhook Integration – Detailed setup and payload structure

  • Webhook Events – Complete list of supported webhook triggers

Last updated

Was this helpful?