Webhooks & Callbacks
Receive real-time notifications when batch jobs complete or events occur.
Overview
For long-running batch operations, AizelCommerce sends webhook notifications to your specified endpoint when stages complete or errors occur.
Setup
# Specify callback URL in any batch operation
job = client.pipeline.run(
products=catalog,
callback_url="https://your-app.com/webhooks/aizel",
callback_events=["stage_complete", "job_complete", "error"]
)
Webhook Payload
{
"event": "stage_complete",
"job_id": "job_a1b2c3d4",
"stage": "image_generation",
"progress": 0.65,
"completed_items": 32500,
"total_items": 50000,
"timestamp": "2025-06-15T14:30:00Z",
"results_url": "https://api.aizelcommerce.com/v1/jobs/job_a1b2c3d4/results"
}
Event Types
| Event | Trigger |
|---|---|
stage_complete |
A pipeline stage finishes |
job_complete |
Entire job finishes successfully |
error |
Unrecoverable error in processing |
payment_settled |
On-chain payment confirmed |
price_change |
Competitor price change detected (tracking) |
Verification
All webhooks include an X-Aizel-Signature header for verification:
import hmac, hashlib
def verify_webhook(payload, signature, secret):
expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)