-
Notifications
You must be signed in to change notification settings - Fork 6
Webhooks
KristofersOzolinsMagebit edited this page Oct 14, 2025
·
1 revision
- Order created/updated webhook dispatch
- Refund observer integration (credit memo)
- Configurable webhook URL and secret
- HMAC-SHA256 signature header
Merchant-Signature - Request metadata headers:
Request-Id,Timestamp - Toggle enable/disable via config
- Overview
- Events
- Payload and headers
- Security and validation
- Configuration
- Troubleshooting
- References
The module sends webhooks to your endpoint for key order lifecycle events. Webhooks are signed and include request metadata headers. Dispatch is handled centrally by the WebhookService.
-
order_created: Sent after a successful session completion and order placement. -
order_updated: Sent on order updates, including refunds (credit memos).
Internals:
- Order created/updated webhooks are prepared via data mappers and dispatched through
WebhookService::dispatch. - Refunds are hooked via the
sales_order_creditmemo_refundevent and sendorder_updatedwith refund data.
- JSON payload shaped by
WebhookEventInterfacewith nestedEventDataInterface. - Headers set by the service:
-
Merchant-Signature: HMAC-SHA256 of the payload using the configured secret -
Request-Id: Checkout session ID (AC order id) -
Timestamp: ISO‑8601 time of dispatch -
Content-Type:application/json
-
- The module computes
Merchant-Signatureas HMAC‑SHA256 over the raw payload using the configured secret. - It includes
Request-Id(session id) andTimestampheaders with each request. - It sends
Content-Type: application/jsonand the accurateContent-Length. - It does not retry failed deliveries automatically (TODO); non‑2xx responses are logged.
- Success and failure events are logged via a dedicated logger to
/var/log/agentic_commerce_webhooks.log. - Critical exceptions during dispatch are logged with context (type, signature, session id).
- General module actions (non-webhook) log to
/var/log/agentic_commerce.log.
Admin: Stores -> Settings -> Configuration -> Magebit -> Agentic Commerce -> Agentic Checkout
- Enable Webhooks
- Webhook URL
- Webhook Secret
- Order Status Map to ACP lifecycle
- No events: ensure Enable Webhooks is on and URL/secret are configured.
- 4xx from receiver: validate headers and payload; check receiver auth/allowlist.
- Signature mismatch: verify the exact raw payload and secret used in HMAC.
- ACP Concepts:
https://developers.openai.com/commerce/guides/key-concepts