Backend API
Update a webhook.
Arguments
id
objectIdrequiredThe unique identifier for the webhook.
alias
stringAlias used to refer to the webhook configuration.
url
stringURL endpoint for the webhook.
events
stringArray of trigger events for the webhook.
enabled
booleanDetermines whether the webhook is enabled. Defaults to false.
retry_disabled_events
booleanDetermines whether the webhook retries disabled events.
schedule
objectSchedule for specifying when a webhook is to be fired.
schedule.hour
intThe hour for which to fire the webhook. Min 0, max 23.
schedule.month_day
intThe day of the month for which to fire the webhook. Min 1, max 31.
schedule.month
intThe month for which to fire the webhook. Min 1, max 12.
schedule.week_day
intThe month for which to fire the webhook. Min 0, max 6.
date_scheduled
dateDate for which the webhook is scheduled to fire.
Update
const swell = require('swell-node').init('store-id', 'secret-key');
await swell.put('/webhooks/{id}', {
id: '6151f193ae97e82ccbf6f0a7',
enabled: true,
date_scheduled: "2022-04-20T16:20:69.000Z",
});
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"
}