> 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/working-with-webhooks/transaction-webhooks.md).

# Transaction Webhooks

**Transaction webhooks** notify your application when transaction events occur. They provide asynchronous notifications for transaction results and are especially useful for recurring and offline transactions.

### Supported transaction events

The transaction webhooks support the following events:

* Authorization
* Capture
* Sale
* Forced Sale
* Refund
* Unmatched Refund
* Void
* ACH Credit
* ACH Debit

### Webhook payload

The transaction webhook includes the same transaction response returned by the corresponding transaction API, with an additional `signature` field that you can use to verify the authenticity and integrity of the webhook payload.

#### Sample payload

{% code lineNumbers="true" %}

```json
{
    "code": "200",
    "status": "success",
    "exchange-id": "ID-clearent-cgw-1-1710772535480-0-24101130",
    "links": [
        {
            "rel": "transaction",
            "href": "/rest/v2/transactions?id=117834254",
            "id": "117834254"
        }
    ],
    "payload": {
        "transaction": {
            "amount": "100.00",
            "id": "117834254",
            "created": "2024-04-09 14:53:24.148",
            "type": "SALE",
            "result": "APPROVED",
            "billing": {
                "zip": "85284"
            },
…
   "signature": "30650230447b36ebeb3aa57faec5141ea73ee3b6f0110dadb1c16dd7fffc7c0c8815879c67f1914910b81955f8685d669e06abd502310088b0260519094aa000077ced6f9c0ad686ca955c89e19e0b5303247b71c8785b4e561f24cba66b273bfcb28f1b066314"
}
```

{% endcode %}

For information about verifying the webhook signature, see [Digital signature](#digital-signature).

### Digital signature

Each supported transaction webhook includes a `signature` field that helps you verify the webhook payload.

Verifying the digital signature helps confirm that:

* The webhook notification was sent by Xplor Pay.
* The webhook payload was not modified during transmission.

If you receive a webhook that can't be verified, treat it as untrusted and don't process the transaction.

### Verify digital signature

You can verify the webhook signature in either of the following ways.

{% stepper %}
{% step %}

#### Verify locally (recommended)

Verify the webhook signature in your application by using the public key for the terminal that processed the transaction.

Local verification is recommended for production integration because it does not require an additional API request.

{% hint style="info" %}
If you need implementation guidance, contact our Integration Specialist to verify the signature.
{% endhint %}
{% endstep %}

{% step %}

#### Use Hosted Payment Page signature verification service

Alternatively, send a POST request to the `/rest/v2/hpp/verify` endpoint. The service validates the webhook signature and returns whether the webhook payload is valid.

Include the complete webhook payload in the request body. For complete endpoint details, see [HPP signature verification service](https://docs.xplorpay.com/api-reference/api/payments/cards-card-not-present/hpp-signature-verification/hpp-verification-service).

{% hint style="info" %}
The signature verification service returns only the verification result. It does not return the original transaction payload.
{% endhint %}

#### Request headers

<pre class="language-json" data-overflow="wrap" data-line-numbers><code class="lang-json">Accept: application/json
Content-Type: application/json
<strong>Public-Key: YOUR-PUBLIC-KEY-GOES-HERE
</strong></code></pre>

{% endstep %}
{% endstepper %}

### Public key

Use the public key associated with the terminal that processed the transaction when verifying webhook signatures.

<table><thead><tr><th width="230.4000244140625" valign="top">Environment</th><th valign="top">Contact</th></tr></thead><tbody><tr><td valign="top">Integration (INT)</td><td valign="top">Contact the Xplor Pay integrations team.</td></tr><tr><td valign="top">Production</td><td valign="top">Contact the Xplor Pay support team.</td></tr></tbody></table>

{% hint style="warning" %}
Each terminal has a unique public key. Always use the public key associated with the terminal that generated the webhook you're verifying.
{% endhint %}


---

# 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/working-with-webhooks/transaction-webhooks.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.
