Overview

Webhooks are a tool used to automatically send data between two applications when a specific event occurs. For example, when an order is placed in one system, the webhook sends the data to another system in real-time, allowing the second application to act without manual intervention. In CommerceHub, you can set up webhooks for various predefined events. Lean how to setup webhook here.


Basic Information

In this section, you will define the key details for your webhook, including its name, the type of entity it will track, and the specific event that will trigger the webhook. Additionally, you'll configure how the webhook will communicate with the target system.


FieldDescriptionField Type
NameEnter the name of the webhook.Free Text
Entity TypeSelect the type of entity to track (e.g., Order, Product, Customer).Dropdown List
Event TypeChoose the type of event to trigger the webhook (e.g., Created, Updated, Cancelled).Dropdown List
Target TypeSelect how the data will be shared: REST API or Azure Queue.Dropdown List
Auth MethodChoose the method of authentication (e.g., Basic Auth, OAuth).Dropdown List
Custom HeadersSet custom headers by entering Key and Value pairs.Free Text
ChannelsSelect one or more channels to receive data (e.g., App, Web, Store, MarketPlace).Multi-Select


Webhook Settings

This section is where you'll configure the details of the message that will be sent by the webhook. This includes the destination URL, the format in which the data will be sent, and the message template structure.


FieldDescriptionField Type
Destination URLEnter the destination URL (select either HTTP or HTTPS).Free Text Field
Message FormatChoose the message format: JSON or XML.Radio Button
Message TemplateDefine the message structure based on the entity and event type.Free Text Field


Webhook Flags

Webhook flags are additional settings that allow you to control encryption, activation status, and notifications for the webhook. These settings provide more flexibility for your integration needs.


FieldDescriptionField Type
Is EncryptEnable encryption for the webhook.Checkbox
Is ActiveActivate or deactivate the webhook.Checkbox
Is Firebase NotificationSpecify if the webhook triggers a Firebase notification.Checkbox




Entity & Event Types

In eCommerce, each webhook can be associated with a specific Entity Type and corresponding Event Type. The Entity Type represents the resource or object being tracked (e.g., a customer, an order), while the Event Type refers to the specific action that triggers the webhook (e.g., an order being created, a customer being updated). The below table outlines common entity types and their associated event types:


Entity TypeEvent TypeDescription
CompanyCompanyCreated, CompanyUpdatedTriggers when a new company is created in the B2B module. Triggers when company details are updated in the B2B module.
CustomerCustomerCreated, CustomerUpdated, CustomerDeleted, CustomerNewsletterSubscribe, CustomerNewsletterUnsubscribeFires when a new customer account is created. Triggers when customer details are updated. Notifies when a customer account is deleted. Notifies when a customer subscribes to newsletters. Notifies when a customer unsubscribes from newsletters.
OrdersOrderCreated, OrderApproved, OrderCancelled, OrderDelivered, OrderUpdatedTriggers when a new order is created. Fires when an order is approved. Notifies when an order is canceled. Fires when an order is marked as delivered. Notifies when the details of an order are updated.
OrderLinesOrderLineCreated, OrderLineUpdated, OrderLineDeletedTriggers when a new order line (individual product in an order) is created. Notifies when an individual order line is updated. Notifies when an order line is deleted.
ProductProductCreated, ProductUpdated, ProductPriceUpdatedTriggers when a new product is created in the catalog. Triggers when product details are updated. Fires when the price of a product is updated.
PromotionPromotionCreated, PromotionUpdatedFires when a new promotion is created. Notifies when an existing promotion is updated.
QuotesQuoteCreated, QuoteUpdatedNotifies when a new quote is created. Notifies when an existing quote is updated.
RMARMACreate, RMAReceivedFires when a return request (RMA) is created. Notifies when a return (RMA) is received.
StoreStoreCreated, StoreUpdatedTriggers when a new store is created in the system. Fires when store details are updated.



Target Types

The Target Type specifies where the webhook data is sent upon being triggered by an event. In CommerceHub, the following target types are supported:


Target TypeDescription
REST APISends data to a REST API endpoint. Supported HTTP methods include GET, POST, PUT, PATCH, DELETE, and more.
Azure QueuePushes messages to an Azure Queue for further processing or handling.



Authentication Types

Webhooks can be secured with various authentication methods to ensure that data is sent securely. The available authentication types are as follows:


Authentication TypeDescription
NoneNo authentication is required for the webhook.
BasicRequires a username and password for authentication.
TokenUtilizes a token for secure authentication.
OAuthAuthenticates using the OAuth protocol for secure access.



Custom Headers

When configuring webhooks, you have the option to add Custom Headers. These headers provide additional metadata or information that the receiving server may require. Custom headers can be used for various purposes, such as passing authentication tokens, defining content types, or including other necessary information for the receiving application. Common use cases include:


Header FieldDescription
KeySpecifies the name of the custom header.
ValueDefines the value associated with the custom header.



Additional Options

Here are some extra tools to help you manage your webhooks more efficiently:

  • View Variables: Shows available variables for use in message templates. Detailed variable list can be found in this article.
  • View Changelog: Displays changes made to the webhook configuration.
  • Post Webhook Logs: View logs for tracking webhook activities.