Building robust integrations with OrderCloud often involves leveraging webhooks to react to specific events. However, many developers encounter a common issue: webhooks may trigger flawlessly when the associated events are executed from within the integrated apps but fail to fire when those associated events are initiated from within the OrderCloud portal. It took a little while for me to figure out, so thought to share with the community so it helps someone who might be looking for it. Let’s dive into the solution.
If you have configured all required fields in the expected format during webhook creation, then the most likely root cause is that you haven’t selected the right API client configured on the webhook(indicated in the below screenshot) when you execute the associated event (Eg: Create Product) from the portal.
While executing the associated event (e.g., creating a product) in the portal, carefully choose the appropriate API client and user context from the top-left selector, as highlighted in the screenshot below. This crucial step establishes the correct permissions and context for the webhook to trigger. This step is required even if you are Marketplace Owner/Admin or even if you have FullAccess.
Hope this saved some time for you!