> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.omegatheme.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Webhook 设置

### Webhook 集成配置说明
#### 基本设置
* **您的接收端URL:** `http://webhook.endpoint.url`
* **请求方式:** POST
* **CURL示例:**

```
curl -X POST "http://webhook.endpoint.url" \
     -H "X-QuoteSnap: $signature" \
     -d '{
           "product_list": YOUR_PRODUCT_LIST_JSON,
           "customer_info": YOUR_CUSTOMER_INFO_JSON
         }'
```
#### 安全验证
* **请求头:**
    * 包含 `X-QuoteSnap` 签名（HMAC SHA256加密）
    * 签名生成方式：
        * **加密算法:** SHA256
        * **密钥:** 您在设置页面生成的 `apiKey`
        * **加密数据:** 您的商店域名（如 `mystore.myshopify.com`）
    * 您的服务端需验证此签名，确保请求来自QuoteSnap
* **请求头示例:**
text
Copy
Download
```
"X-QuoteSnap: $signature"
```
#### 请求数据结构
* **类型:** JSON对象
* **示例数据:**

```
{
    "product_list": [
        {
            "id": 7975041237150,
            "title": "Appointment",
            "vendor": "kietdt-store",
            "handle": "appointment",
            "quantity": 1,
            "variant": {
                "id": 44057763938462,
                "title": null,
                "price": 10,
                "basePrice": 10,
                "sku": null,
                "priceText": "10₫"
            },
            "message": null,
            "total": 10,
            "totalPrice": "10₫",
            "trackingSource": null,
            "properties": [],
            "pageChoosen": "product",
            "priceCountDiscount": 1000,
            "currencyShop": "{{amount_no_decimals_with_comma_separator}}₫",
            "variants": [
                {
                    "id": 44057763938462,
                    "title": null,
                    "price": 10,
                    "basePrice": 10,
                    "sku": null,
                    "priceText": "10₫"
                }
            ],
            "product_info": [
                {
                    "id": 139218,
                    "max": 20,
                    "min": 0,
                    "req": 1,
                    "send": 1,
                    "type": "text",
                    "input": "text",
                    "label": "Detail inquiry",
                    "width": 100,
                    "placeholder": "Enter your inquiry",
                    "value": "aaa"
                }
            ],
            "offer_price": null
        }
    ],
    "customer_info": [
        {
            "label": "Name",
            "value": "My name"
        },
        {
            "label": "Email",
            "value": "example@gmail.com"
        },
        {
            "label": "Message",
            "value": "Quote Snapp"
        },
        {
            "label": "Select",
            "value": "Option 1"
        }
    ]
}
```
#### 关键字段说明
1. **product_list**
    * 包含客户询价的所有商品详情
    * 支持多商品、多规格（variants）
    * 可获取自定义表单字段（product_info）
2. **customer_info**
    * 客户提交的联系信息和留言
    * 动态包含您在表单构建器中设置的所有字段
#### 注意事项
1. 请确保您的服务端能处理JSON格式POST请求
2. 务必实现签名验证（X-QuoteSnap）保障数据安全
3. 测试时建议使用[在线HMAC验证工具](https://www.freeformatter.com/hmac-generator.html)核对签名
如需技术支持，请联系我们的[开发团队](https://mailto:dev-support@quotesnap.com/)。