Overview
Several Henry operations are async - they return immediately with arefId and a status, and results arrive once processing completes. You poll the corresponding poll* endpoint until status reaches a terminal state.
Operations that follow this pattern:
| Operation | Trigger | Poller |
|---|---|---|
| Product search | products.search | products.pollSearch |
| Product details | products.details | products.pollDetails |
| Headless checkout | cart.checkout.purchase | cart.checkout.pollPurchase |
| Checkout details | cart.checkout.details | cart.checkout.pollDetails |
Statuses
| Status | Terminal | Action |
|---|---|---|
pending | No | Keep polling |
processing | No | Keep polling |
complete | ✅ | Read result |
failed | ✅ | Log error, investigate and retry |
Reusable poll helper
This generic helper works for any Henry async operation. Drop it in a shared utility file and import it wherever you need it.Examples
Product search
Product details
Headless checkout
Purchase is async too - Henry places the order with the merchant(s) in the background.Tips
ThepollJob helper defaults to 1s intervals and 60 attempts, which works for most cases. Product search and details typically complete in 2–5 seconds; orders take longer since Henry places them with the merchant.
For order fulfillment, consider skipping polling entirely - Webhooks let Henry push results to you instead.
Next steps
Webhooks
Skip polling for order events - have Henry push results to your server instead
Order Management
List and filter orders after checkout