Update a webhook
Updates an existing webhook entry.
Important Note: if provideAccount
, expandTransactions
, or expandPayments
are excluded from the update request, they will be reset to their default values.
Body Required
-
The unique endpoint ID, for example the integration name. Case sensitive.
-
The URL which this endpoint points to.
-
withBasicAuth boolean
If basic auth should be used, defaults to false.
Default value is
false
. -
username string
The username for basic auth.
-
password string
The password for basic auth.
-
provideAccount boolean
Whether or not to include account info in the notification.
Default value is
false
. -
expandTransactions boolean
Whether or not to include transaction lines in the notification.
Default value is
false
. -
expandPayments boolean
Whether or not to include payment lines in the notification.
Default value is
false
. -
subscribeTo array[object]
POST
/o/wh/1/webhook
curl \
-X POST https://api.lsk.lightspeed.app/o/wh/1/webhook \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"endpointId":"MY-AWESOME-ENDPOINT-ID","url":"https://webhook.site/1dc40b86-3d0d","withBasicAuth":true,"username":"username","password":"password","provideAccount":true,"expandTransactions":true,"expandPayments":true,"subscribeTo":[{"name":"DELIVERED","resource":"order"}]}'
Request examples
{
"endpointId": "MY-AWESOME-ENDPOINT-ID",
"url": "https://webhook.site/1dc40b86-3d0d",
"withBasicAuth": true,
"username": "username",
"password": "password",
"provideAccount": true,
"expandTransactions": true,
"expandPayments": true,
"subscribeTo": [
{
"name": "DELIVERED",
"resource": "order"
}
]
}
Response examples (200)
{
"endpointId": "MY-AWESOME-ENDPOINT-ID",
"url": "https://webhook.site/1dc40b86-3d0d",
"withBasicAuth": true,
"username": "username",
"password": "password",
"provideAccount": true,
"expandTransactions": true,
"expandPayments": true,
"subscribeTo": [
{
"name": "DELIVERED",
"resource": "order"
}
]
}
Response examples (400)
{
"timestamp": "2023-11-07T19:15:05.043+0000",
"status": 400,
"error": "Bad Request",
"message": "Validation failed for object='webhookEndpointDto'. Error count: 1",
"errors": [
{
"codes": [
"NotNull.webhookEndpointDto.endpointId",
"NotNull.endpointId",
"NotNull.java.lang.String",
"NotNull"
],
"arguments": [
{
"codes": [
"webhookEndpointDto.endpointId",
"endpointId"
],
"defaultMessage": "endpointId",
"code": "endpointId"
}
],
"defaultMessage": "must not be null",
"objectName": "webhookEndpointDto",
"field": "endpointId",
"bindingFailure": false,
"code": "NotNull"
}
],
"path": "/o/wh/1/webhook"
}