> ## Documentation Index
> Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook 回调

Webhooks are a crucial part of the Spark API, as they serve as automatic callbacks that alert your system to important events without requiring constant monitoring. For example, the `DeclineCallback` is triggered if a transaction fails after a successful `TriggerTransaction` request. This could happen if a consumer cancels the transaction on the device or if the terminal times out. Other webhooks, like `TimeoutCallback` and `StopCallback`, let you know when a session has timed out or when a card has been presented to stop a session, respectively.

通过使用这些回调函数，您可以快速处理故障和其他事件，确保系统的事务状态保持准确，而无需不断轮询。

## 可用的 Webhook

> **[TransactionCallback](https://devzone.nayax.com/docs/integrate-pos-device/spark/webhook-callbacks/transactioncallback.md)**

> **[停止回调](https://devzone.nayax.com/docs/integrate-pos-device/spark/webhook-callbacks/stopcallback.md)**

> **[超时回调](https://devzone.nayax.com/docs/integrate-pos-device/spark/webhook-callbacks/timeoutcallback.md)**

> **[拒绝回调](https://devzone.nayax.com/docs/integrate-pos-device/spark/webhook-callbacks/declinecallback.md)**

### 启用自定义标头（可选）

此功能允许 Nayax 在每次回调到您的系统时发送最多两个静态自定义标头（例如，用于共享密钥或路由 ID），以增强安全性和验证。

要为您的集成启用自定义标头：

1. **请求启用**– 联系您的 Nayax 集成支持工程师，并请求在 Nayax 后台中为您的集成启用自定义标头。
2. 提供请求头详细信息——与您的集成支持工程师共享以下信息：
   * 标题键 – 最多 2 个键（最少 1 个）。
   * 标题值 – 最多 2 个值（最少 1 个）。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.