Webhooks
Closku uses webhooks to notify your integration of events: try-on completions, failures, subscription changes, and more. Design your handlers for idempotency and reliable processing.
Event model
Closku webhooks deliver real-time notifications when events occur in the platform. Each event has a type, a unique ID, and a payload with the relevant data:
| Event type | Triggered when |
|---|---|
| try_on_complete | A try-on rendering finishes successfully |
| try_on_fail | A try-on rendering could not be completed |
| try_on_timeout | A try-on rendering exceeded the timeout limit |
| catalog.updated | Product catalog sync completes |
| subscription.changed | Plan tier or billing state changes |
| usage.limit_reached | Monthly try-on cap is reached |
Note: catalog.updated, subscription.changed, and usage.limit_reached events are planned for a future release and not yet available.
Delivery and retry
Assume events can arrive more than once and may not arrive in the sequence your application prefers. Your consumers should be correct under replay and partial delay. Use the event ID to de-duplicate: store processed event IDs and skip replays. Closku retries failed deliveries with exponential backoff for up to 24 hours. Events are delivered at-least-once, so use event timestamps for ordering rather than delivery order. Respond with 200 within 5 seconds, as slow handlers risk retries and duplicate processing.
Webhook endpoint requirements
Your webhook endpoint must respond with HTTP 200 to acknowledge receipt (the response body is not inspected). It needs to be publicly accessible via HTTPS, validate the webhook signature using the shared secret to verify the payload is from Closku, and handle payloads up to 1MB. If a consumer cannot process an event safely, return a non-2xx status and Closku will retry. Do not silently drop events that fail processing.
Next steps
Error handling, retries, and debugging.
Try-on lifecycle and event triggers.
Related pages
API credential management.
Webhook handling examples.