Set webhook configuration
const url = 'https://api.sulpayments.ch/v1/webhook';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"webhook_secret":"example","webhook_url":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.sulpayments.ch/v1/webhook \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "webhook_secret": "example", "webhook_url": "example" }'Configures where settlement-completed notifications are POSTed for the
authenticated merchant, and the secret they are signed with. A null or empty
webhook_url clears the endpoint. The URL must be a public https(s) address
(internal/loopback/metadata hosts are rejected). The secret is required the
first time a URL is set; a later URL change may omit it to keep the current
secret.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”What a merchant sends to configure its webhook. A null/empty url clears the endpoint (and retires the secret with it). The secret is chosen by the merchant — it must know it to verify the signatures — and is required the first time a url is set; a later url change may omit it to keep the current one.
object
Examplegenerated
{ "webhook_secret": "example", "webhook_url": "example"}Responses
Section titled “Responses”Updated configuration
A merchant's own webhook configuration, as it sees it. The secret is never returned — only whether one is set.
object
Examplegenerated
{ "webhook_secret_set": true, "webhook_url": "example"}Invalid URL or missing secret
The error envelope every 4xx/5xx response uses. The error.code is
machine-stable across locales; error.message is localized via the
request's Accept-Language (en by default). error.fields is present only
for per-field validation failures.
object
The body of an [ErrorEnvelope].
object
Machine-stable error code (stable across locales).
Per-field validation errors, present only for validation_failed.
One field-level validation failure inside [ApiError::fields].
object
The machine-stable reason code for this field.
The request field the error applies to (e.g. webhook_url).
Human-readable message, localized by Accept-Language.
Example
{ "error": { "code": "invalid_credentials", "fields": [ { "code": "invalid_credentials" } ], "message": "One or more fields are invalid." }}Missing or invalid API key
The error envelope every 4xx/5xx response uses. The error.code is
machine-stable across locales; error.message is localized via the
request's Accept-Language (en by default). error.fields is present only
for per-field validation failures.
object
The body of an [ErrorEnvelope].
object
Machine-stable error code (stable across locales).
Per-field validation errors, present only for validation_failed.
One field-level validation failure inside [ApiError::fields].
object
The machine-stable reason code for this field.
The request field the error applies to (e.g. webhook_url).
Human-readable message, localized by Accept-Language.
Example
{ "error": { "code": "invalid_credentials", "fields": [ { "code": "invalid_credentials" } ], "message": "One or more fields are invalid." }}