Why Webhooks?
VIZOCHOK stores your product catalog (names, descriptions, categories) for AI search, but prices and stock live on your side. When the AI finds products matching a customer query, VIZOCHOK calls your webhook to get current prices and availability before showing results. The same approach applies to cart operations: when the AI adds an item to the cart, your backend confirms the action and maintains the authoritative cart state.VIZOCHOK calls your products_url webhook
Your backend receives the list of SKUs and returns current prices and availability.
Webhook Endpoints
You need to implement up to three endpoints on your backend:| Webhook | Purpose | Required |
|---|---|---|
| Products URL | Returns prices and stock for a list of SKUs | Yes |
| Cart URL | Processes cart operations (add, remove, update, clear) | Recommended |
| Cart GET URL | Returns current cart contents for session initialization | Optional |
Setup in Admin Panel
Open Webhook Settings
Log into the Admin Panel, navigate to Settings > Webhooks.
Configure Endpoints
Enter the URLs for your webhook endpoints:
- Products URL:
https://your-api.com/api/vizochok/check-products - Cart URL:
https://your-api.com/api/vizochok/cart - Cart GET URL:
https://your-api.com/api/vizochok/cart/items - Timeout: How long VIZOCHOK waits for your response (default: 5 seconds)
Setup via API
You can also configure webhooks programmatically:Testing Webhooks
The admin panel includes a built-in webhook test. You can also test from the API:Error Handling & Retries
VIZOCHOK handles webhook failures gracefully:- Products webhook: On timeout or error, all requested products are treated as unavailable. The AI tells the customer that products could not be loaded.
- Cart webhook: On failure, returns
{ok: false, reason: "webhook_timeout"}or{ok: false, reason: "webhook_error"}. The AI informs the customer the operation failed. - Retries: VIZOCHOK retries once on 5xx errors or timeouts, with a 1-second delay between attempts.
- Timeouts: Default is 5 seconds. Configurable per tenant (in the webhook settings).
Security
Every webhook request includes an HMAC-SHA256 signature and timestamp. See Signature Verification for the full specification and code examples. Headers included with every request:| Header | Description |
|---|---|
X-VIZOCHOK-Signature | sha256=<hex_digest> HMAC signature |
X-VIZOCHOK-Timestamp | Unix timestamp (seconds) |
Content-Type | application/json |
Implementation Guides
For complete request/response specifications and handler examples:Products Webhook
Implement the products pricing endpoint.
Cart Webhook
Handle cart add, remove, update, and clear operations.
Signature Verification
Verify HMAC-SHA256 signatures with code examples.
Cart Sync Guide
Understand the full cart synchronization flow.