> 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

The **Transaction** **webhooks** notify your application when transaction events occur. They provide asynchronous notifications for transaction results, including successful and failed transactions, 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, you can use POST method with the `/rest/v2/hpp/verify` endpoint to validate the webhook signature and returns the verification result indicating 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 to Xplor Pay Integrations team</td></tr><tr><td valign="top">Production</td><td valign="top">Contact to 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xplorpay.com/api-reference/webhooks/working-with-webhooks/transaction-webhooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
