Backend API
Update a webhook.
Arguments
idobjectIdrequired
The unique identifier for the webhook.
aliasstring
Alias used to refer to the webhook configuration.
urlstring
URL endpoint for the webhook.
eventsstring
Array of trigger events for the webhook.
enabledboolean
Determines whether the webhook is enabled. Defaults to false.
retry_disabled_eventsboolean
Determines whether the webhook retries disabled events.
scheduleobject
Schedule for specifying when a webhook is to be fired.
schedule.hourint
The hour for which to fire the webhook. Min 0, max 23.
schedule.month_dayint
The day of the month for which to fire the webhook. Min 1, max 31.
schedule.monthint
The month for which to fire the webhook. Min 1, max 12.
schedule.week_dayint
The month for which to fire the webhook. Min 0, max 6.
date_scheduleddate
Date for which the webhook is scheduled to fire.
Update
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.put('/:webhooks/{id}', {
id: '6151f193ae97e82ccbf6f0a7',
enabled: true
});The webhook model
{
"url": "http://localhost:5000",
"enabled": false,
"alias": "webhook",
"description": null,
"events": [
"order.created",
"order.submitted",
"order.updated"
],
"api": "com",
"date_final_attempt": null,
"date_scheduled": null,
"date_created": "2021-09-27T16:30:11.837Z",
"date_updated": "2021-10-28T16:04:21.648Z",
"id": "6151f193ae97e82ccbf6f0a7"
}