> For the complete documentation index, see [llms.txt](https://docs.xplorpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplorpay.com/api-reference/webhooks/webhook-authentication.md).

# Webhook Authentication

Understand the authentication methods, configuration requirements, and supported events for Legacy and Enhanced webhooks.

Xplor Pay supports Legacy webhooks and Enhanced webhooks implementations. Each implementation has a different configuration process and authentication method.

Before implementing webhook authentication, identify which webhook implementation is configured for your integration.

### Webhook types

The following table summarizes the differences between the two implementations.

<table data-search="true"><thead><tr><th>Comparison area</th><th>Legacy webhooks</th><th>Enhanced webhooks</th></tr></thead><tbody><tr><td>Setup and management</td><td>Merchants can configure supported transaction alerts through Virtual Terminal (VT), using the existing legacy setup process.</td><td>Setup is handled internally by Xplor Pay.</td></tr><tr><td>Configuration level</td><td>Configured for individual merchant accounts through <a href="https://docs.xplorpay.com/api-reference/webhooks/prerequisites#virtual-terminal-users">Virtual Terminal</a> (VT), where applicable.</td><td>Can be enabled and customized for an individual merchant or an entire partner portfolio/HNK.</td></tr><tr><td>Authentication method</td><td>Existing legacy authentication. Digital-signature verification applies to <a href="https://docs.xplorpay.com/api-reference/webhooks/working-with-webhooks/transaction-webhooks">Transaction Webhooks</a> only.</td><td>Optional shared-secret authentication using the <code>X-Webhook-Secret</code> HTTP request header.</td></tr><tr><td>Supported events</td><td>Includes the existing Transaction, Onboarding, and Equipment webhooks.</td><td>ACH and card events listed in the Enhanced webhook events section below.</td></tr></tbody></table>

For legacy webhook registration and configuration details, see:

* [Webhook notifications](https://docs.xplorpay.com/api-reference/webhooks/register-url#webhook-notifications)
* [Webhook configuration](https://docs.xplorpay.com/api-reference/webhooks/prerequisites#webhook-configuration)
* [Transaction Webhooks](https://docs.xplorpay.com/api-reference/webhooks/working-with-webhooks/transaction-webhooks)
* [Webhook Subscriptions](https://docs.xplorpay.com/api-reference/webhooks/webhook-subscriptions)

### Legacy webhook authentication

Legacy webhooks use the existing authentication process.

Transaction webhooks include a `signature` field in the webhook payload. You can verify this digital signature to confirm that Xplor Pay sent the notification and that the payload was not modified during transmission.

You can verify the signature in either of the following ways:

* **Local verification (recommended):** Verify the signature in your application using the public key associated with the terminal that processed the transaction.
* **Hosted Payment Page signature verification service:** Send the complete webhook payload to the `/rest/v2/hpp/verify` endpoint to validate the signature.

Each terminal has a unique public key. Use the public key associated with the terminal that processed the transaction.

{% hint style="info" %}
Signature verification applies to Transaction Webhooks only. Other legacy webhooks do not include signature validation.
{% endhint %}

For implementation details, see [Transaction Webhooks - Digital Signature](https://docs.xplorpay.com/api-reference/webhooks/working-with-webhooks/transaction-webhooks#digital-signature).

### Enhanced webhook authentication

Enhanced webhooks support optional shared-secret authentication. This lets you verify incoming webhook requests before processing them.

Xplor Pay handles the setup of enhanced webhooks internally. Supported events can be enabled and customized for an individual merchant or an entire partner portfolio/HNK.

When a secret is configured for your webhook configuration, Xplor Pay includes it in the `X-Webhook-Secret` HTTP request header. Your application can validate this header before processing a webhook event.

If no secret is configured, Xplor Pay omits the `X-Webhook-Secret` header.

#### Enhanced webhook events

The following ACH and card transaction events are available through Enhanced webhooks.

**ACH events**

For more information about ACH webhook notifications, see [ACH Transaction Status Webhooks](https://docs.xplorpay.com/api-reference/webhooks/working-with-webhooks/ach-transaction-status-webhooks).

| Event                             | Event identifier                           |
| --------------------------------- | ------------------------------------------ |
| Chargeback                        | `ach.status.chargeback`                    |
| Returned                          | `ach.status.returned`                      |
| Rejected – Account Invalid        | `ach.status.rejectedaccountinvalid`        |
| Rejected – Authorization Declined | `ach.status.rejectedauthorizationdeclined` |
| Rejected – Voiding                | `ach.status.rejectedvoiding`               |
| Rejected – Voided                 | `ach.status.rejectedvoided`                |
| Settled                           | `ach.status.settled`                       |
| Updated                           | `ach.status.updated`                       |

**Card events**

For more information about card authorization notifications, see [Card Authorization Result Webhooks](https://docs.xplorpay.com/api-reference/webhooks/working-with-webhooks/card-authorization-result-webhooks).

<table data-search="true"><thead><tr><th>Event</th><th>Event identifier</th></tr></thead><tbody><tr><td>Authorization Approved</td><td><code>card.authorization.approved</code></td></tr><tr><td>Authorization Declined</td><td><code>card.authorization.declined</code></td></tr><tr><td>Authorization Failed</td><td><code>card.authorization.failed</code></td></tr></tbody></table>

### Configure a webhook secret

To enable shared-secret authentication:

1. Generate a secret for your webhook endpoint.
2. Store the secret securely in your application.
3. Share the secret with Xplor Pay Support team through the approved secure secret-sharing process.
4. Specify the webhook types and categories that require the secret.
5. Xplor Pay configures the secret for the relevant webhook configuration.
6. Verify that your application can read and validate the `X-Webhook-Secret` header.

A single webhook configuration can include multiple webhook types and categories. The secret is stored against that configuration.

{% hint style="info" %}
Do not send the secret through ordinary email, open chat messages, or other unapproved channels.
{% endhint %}

### Secret requirements

The secret must meet the following requirements:

<table data-search="true"><thead><tr><th>Requirement</th><th>Details</th></tr></thead><tbody><tr><td>Header name</td><td><code>X-Webhook-Secret</code></td></tr><tr><td>Format</td><td>Alphanumeric characters and symbols</td></tr><tr><td>Minimum length</td><td>1 character</td></tr><tr><td>Maximum length</td><td>4,000 characters</td></tr><tr><td>Visibility</td><td>The saved secret is not displayed again</td></tr><tr><td>Replacement</td><td>An existing secret can be replaced</td></tr></tbody></table>

{% hint style="warning" %}
Keep your secret confidential. Do not include it in source code, public repositories, screenshots, or application logs.
{% endhint %}

### Inspect the authentication header

When a secret is configured, Xplor Pay includes it in the `X-Webhook-Secret` HTTP request header. For example:

{% code lineNumbers="true" %}

```
Content-Type: application/json
X-webhook-secret: <your-configured-secret>
```

{% endcode %}

### Validate the secret

If shared-secret authentication is configured for your webhook configuration, validate the `X-Webhook-Secret` header before processing a webhook event.

1. Check whether the `X-Webhook-Secret` header is present.
2. If the header is present, compare its value with the secret stored securely in your application.
3. If the values do not match, reject the request without processing the event.
4. If validation succeeds, continue with your normal webhook processing and payload validation.

If no secret is configured for the webhook configuration, Xplor Pay does not include the `X-Webhook-Secret` header.

### Replace a webhook secret

If you need to replace a secret, coordinate the change with Xplor Pay Support team.

1. Generate a new secret and store it securely.
2. Coordinate with Support team to replace the configured secret.
3. Update your application's expected secret as part of the coordinated change.
4. Verify that incoming webhook requests contain the new secret and that your application validates it successfully.

{% hint style="info" %}
Coordinate the replacement with the Support team to avoid authentication failures.
{% endhint %}

#### Troubleshooting

<table data-search="true"><thead><tr><th>Issue</th><th>What to check</th></tr></thead><tbody><tr><td>The <code>X-Webhook-Secret</code> header is missing</td><td>Confirm that a secret is configured for the relevant webhook configuration. If no secret is configured, Xplor Pay omits the header.</td></tr><tr><td>The received secret does not match</td><td>Confirm that your application uses the same secret configured for the webhook. Check for accidental whitespace or configuration errors.</td></tr><tr><td>Authentication fails after replacing the secret</td><td>Confirm that the secret stored in your application matches the configured secret. Coordinate with Xplor Pay Support team if needed.</td></tr><tr><td>The saved secret is no longer visible</td><td>The secret is not displayed after saving. Use your stored copy or coordinate a replacement with Support team.</td></tr></tbody></table>

#### Related topics <a href="#related-topics" id="related-topics"></a>

* [Working with Webhooks](https://docs.xplorpay.com/api-reference/webhooks/working-with-webhooks)
* [Webhooks - Register URL](https://docs.xplorpay.com/api-reference/webhooks/register-url)
* [Webhooks - Prerequisites](https://docs.xplorpay.com/api-reference/webhooks/prerequisites)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xplorpay.com/api-reference/webhooks/webhook-authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
