General Webhook Processor for Transactions

The General Webhook Processor plugin allows you to connect your external systems to Post Affiliate Pro by processing incoming webhook notifications for transaction events. With this plugin, you can automate approval, decline, refund, or chargeback actions on commissions, as well as trigger recurring commissions based on external signals. The plugin offers flexible configuration and is ideal for integrating custom e-commerce platforms, subscription services, or third-party apps with your affiliate program.


How the General Webhook Processor Works

When a webhook (HTTP POST or GET request) is sent to Post Affiliate Pro's webhook endpoint, this plugin authenticates the request and processes key parameters to perform affiliate transaction actions, such as:

  • Approving or declining commissions based on external status updates.
  • Creating a recurring commission when a subscription renewal occurs.
  • Marking a transaction as refunded or as a chargeback.

The plugin uses a shared password for security, and you have full control over which external status values map to "approved" or "declined" in your affiliate system.


Plugin Setup

  1. Activate the General Webhook Processor plugin in your Post Affiliate Pro merchant panel (Configuration > Plugins).
  2. Configure the plugin settings (see below).
  3. Set up your external system to send HTTP requests to your Post Affiliate Pro webhook endpoint (usually https://yourdomain.postaffiliatepro.com/plugins/GeneralWebhookProcessor/hook.php, exact URL can be found by clicking More info next to the plugin's configuration button).

Configuration Options

The plugin offers several configuration fields:

FieldDescription
PasswordA verification password (shared secret) required in the password parameter of incoming webhook requests. Prevents unauthorized use.
Approval statusComma-separated status values from your system that should mark commissions as "approved". E.g., paid, completed.
Decline statusComma-separated status values from your system that should mark commissions as "declined". E.g., canceled, failed.

Note: You must set a password. If left empty, the plugin will generate a random one, but you should use your own for integration security.


Webhook Request Parameters

Your external system should send an HTTP POST or GET request to the plugin's endpoint with the following parameters, depending on the desired action.

Required Parameter (for all actions)

  • password: The shared secret set in the plugin configuration.
  • orderid: The order or transaction identifier.

For Recurring Commissions

  • recurring: Set to true.
  • totalcost: (optional) The transaction value.
  • currency: (optional) Transaction currency.
  • data1 to data5: (optional) Extra custom data fields.

For Status Change (Approval/Decline)

  • pstatus: The new status value from your application. If this matches a configured "Approval status" value, the commission is approved; if it matches a "Decline status" value, the commission is declined.
  • note: (optional) A note to attach to the status change.

For Refunds

  • refund: Set to true.
  • refundvalue: (optional) Amount to refund.
  • note: (optional) Refund note.

For Chargebacks

  • chargeback: Set to true.
  • chargebackvalue: (optional) Amount to charge back.
  • note: (optional) Chargeback note.

Example Webhook Requests

Approve a commission:

POST https://yourdomain.postaffiliatepro.com/plugins/GeneralWebhookProcessor/hook.php
password=MySecretPassword&orderid=12345&pstatus=paid

Decline a commission:

POST https://yourdomain.postaffiliatepro.com/plugins/GeneralWebhookProcessor/hook.php
password=MySecretPassword&orderid=12345&pstatus=canceled

Create a recurring commission:

POST https://yourdomain.postaffiliatepro.com/plugins/GeneralWebhookProcessor/hook.php
password=MySecretPassword&orderid=SUBSCRIPTION123&recurring=true&totalcost=49.00&currency=USD

Mark a transaction as refunded:

POST https://yourdomain.postaffiliatepro.com/plugins/GeneralWebhookProcessor/hook.php
password=MySecretPassword&orderid=12345&refund=true&refundvalue=49.00

Mark a transaction as chargeback:

POST https://yourdomain.postaffiliatepro.com/plugins/GeneralWebhookProcessor/hook.php
password=MySecretPassword&orderid=12345&chargeback=true&chargebackvalue=49.00

Security and Rate Limiting

  • All requests are authenticated using the configured password.
  • The plugin implements a rate limiter (max 10 failed authentication attempts per hour) to protect against brute-force attacks.
  • If the password is missing or incorrect, the request is denied with an appropriate HTTP error code.

Troubleshooting & Tips

  • If you receive a 401 Unauthorized or 501 Not Configured response, check that the password is set and matches between your external system and the plugin configuration.
  • Make sure orderid is provided in every request.
  • Use the event logs found under Tools->Event logs to debug issues (logs are prefixed with GeneralWebhookProcessor:).
  • Only status names listed in the configuration will trigger approval/decline—ensure your status values match exactly.
  • Refund and chargeback actions require the order’s transaction to be found; otherwise, a 404 is returned.
  • Recurring commission handling requires the separate Recurring Commissions feature/plugin to be active.

Screenshots


Summary

The General Webhook Processor is a flexible integration point for automating transaction status updates in Post Affiliate Pro based on external events. With secure, configurable mapping of external statuses and support for recurring, refund, and chargeback actions, it offers a robust solution for integrating affiliate tracking with a wide range of external systems.

If you need further assistance, please contact our support team.

×