A webhook is a notification that can be posted from a website to another when certain actions are taken on the originating website. For example, let's say you have an online service for managing orders that accepts webhooks. Using 3dcart's specific webhooks you can trigger a notification to that online service that will send the applicable information from your 3dcart store to the service.
To create a webhook, follow these steps:
- Log into your 3dcart Online Store Manager
- Using the left hand navigation menu, go to Modules
- Use the search bar at the top to search for "Webhook"
This will bring up the Webhook module which will contain a link labeled "Edit Webhooks"
- Click on the "Edit Webhooks" link
- Look to the top right and click on the "Add Webhook" button
- Enter a name for your webhook
This can be any name you choose and is only used for reference
- Next, enter the URL to your external service's Webhook URL This will be supplied by your external service
- Select whether you'd like for the transmitted data to be posted in either JSON or XML format.
The data payload will be formatted using the REST API format. More information can be found here.
- Next, select the event that will be sent in the payload to the webhook
Currently there are 3 events that can be used for Webhooks:
- Customer New
New customer registers on your store
- Order New
New order is created
- Order Status Change
When an order's status is updated
- Finally, make sure the Webhook is enabled and click "Save" at the top right to have it ready
The webhook will trigger each time the event occurs and send its payload to your external service.