Webhooks

Webhooks is the latest tool available in the ChannelAdvisor integration toolbox to give you more options to control data sync methods and help you build a more efficient relationship with ChannelAdvisor. 

This documentation introduces you to webhooks, including configuration and management steps for ChannelAdvisor webhook events.

What is a Webhook?

A webhook is a method of communication between two systems with the use of callbacks. Webhooks are triggered by an event in the source system (ChannelAdvisor), which results in the source system requesting the configured Webhook URL where a payload for the event is posted.

ChannelAdvisor Webhooks use OAuth 2.0 for REST API Authorization to create an integration in which the client and account(s)/profile(s) are defined. In this integration, the Webhook event(s) subscription is created/configured

Example: a Webhook subscription is created for New Cleared Payment Orders in "My Profile - United States" and will be delivered to the configured HTTPS URL hosted by the client server. When an order changes to "Cleared" Payment Status in ChannelAdvisor, the Webhook subscription posts the order payload to the registered URL.

Why Use Webhooks?

Orders are created frequently in ChannelAdvisor from a number of different channel sources, including the seller/developers. Using APIs, continuous polling is required to locate new orders, but with a webhook event for newly created orders, you can be notified when those orders are created and receive the complete payload of that order.

Use Cases

Webhooks use cases include, but are not limited to:

  • Importing new data from the source system into internal systems.
  • Taking updated data from the source system into internal systems
  • Notifying different team members and other software, partners, and systems about data relevant to to them
    • This includes, but is not not limited to orders, fulfillment, accounting, analytics, and marketing.
  • Collecting data for long-term storage.

Steps to Receive Webhooks

Prerequisites

  • A Developer Key
  • Client Profile Access with admin user log in credentials

You can start receiving event notifications in your system using the steps in this section:

  1. Identify events to monitor and the event payloads to parse.
  2. Create webhook endpoint as an HTTP endpoint (URL) on your local server.
  3. Test your webhook endpoint is working properly.
  4. Deploy your webhook endpoint as a publicly accessible HTTPS URL.
  5. Create webhook configuration, including the webhook HTTPS URL, in the Developer Console.
  6. Accept requests from ChannelAdvisor by returning 2xx response status codes and validate ChannelAdvisor as source and payload creator.
  7. Parse each event object.
  8. Distribute parsed data to your systems.

How Webhooks Work

A webhook is configured based on the existence of an event, and a delivery endpoint (webhook URI) is defined as part of the configuration. 

One or more conditions can exist to trigger an event. When triggered, the source system initiates a POST request to deliver a payload to the delivery endpoint defined. 

At the delivery endpoint, systems are designed to consume each payload at a rate conducive to the unique conditions that exist in those systems. Client code should parse the payload data to capture and distribute it to appropriate locations that align with the business requirements of each system.

As an additional optional path, the payload IDs in entity layers can be used to make requests against the ChannelAdvisor REST API without the need for additional authorizations.