Update Webhook
curl --request PATCH \
--url https://api.example.com/webhooks/{webhook_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"is_active": true,
"event_types": [
"<string>"
],
"receive_simulated_events": true,
"purchase_date_start": "2023-12-25",
"purchase_date_end": "2023-12-25"
}
'import requests
url = "https://api.example.com/webhooks/{webhook_id}"
payload = {
"name": "<string>",
"url": "<string>",
"is_active": True,
"event_types": ["<string>"],
"receive_simulated_events": True,
"purchase_date_start": "2023-12-25",
"purchase_date_end": "2023-12-25"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
url: '<string>',
is_active: true,
event_types: ['<string>'],
receive_simulated_events: true,
purchase_date_start: '2023-12-25',
purchase_date_end: '2023-12-25'
})
};
fetch('https://api.example.com/webhooks/{webhook_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/webhooks/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'url' => '<string>',
'is_active' => true,
'event_types' => [
'<string>'
],
'receive_simulated_events' => true,
'purchase_date_start' => '2023-12-25',
'purchase_date_end' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"is_active\": true,\n \"event_types\": [\n \"<string>\"\n ],\n \"receive_simulated_events\": true,\n \"purchase_date_start\": \"2023-12-25\",\n \"purchase_date_end\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/webhooks/{webhook_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"is_active\": true,\n \"event_types\": [\n \"<string>\"\n ],\n \"receive_simulated_events\": true,\n \"purchase_date_start\": \"2023-12-25\",\n \"purchase_date_end\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/webhooks/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"is_active\": true,\n \"event_types\": [\n \"<string>\"\n ],\n \"receive_simulated_events\": true,\n \"purchase_date_start\": \"2023-12-25\",\n \"purchase_date_end\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"webhook_id": "<string>",
"name": "<string>",
"url": "<string>",
"is_active": true,
"event_types": [
"<string>"
],
"receive_simulated_events": true,
"purchase_date_start": "2023-12-25",
"purchase_date_end": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z"
}Webhooks
Update Webhook
Update a webhook. Omitted fields are unchanged; event_types replaces the subscribed events; explicit null clears a purchase date bound. The signing secret is unchanged.
PATCH
/
webhooks
/
{webhook_id}
Update Webhook
curl --request PATCH \
--url https://api.example.com/webhooks/{webhook_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"is_active": true,
"event_types": [
"<string>"
],
"receive_simulated_events": true,
"purchase_date_start": "2023-12-25",
"purchase_date_end": "2023-12-25"
}
'import requests
url = "https://api.example.com/webhooks/{webhook_id}"
payload = {
"name": "<string>",
"url": "<string>",
"is_active": True,
"event_types": ["<string>"],
"receive_simulated_events": True,
"purchase_date_start": "2023-12-25",
"purchase_date_end": "2023-12-25"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
url: '<string>',
is_active: true,
event_types: ['<string>'],
receive_simulated_events: true,
purchase_date_start: '2023-12-25',
purchase_date_end: '2023-12-25'
})
};
fetch('https://api.example.com/webhooks/{webhook_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/webhooks/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'url' => '<string>',
'is_active' => true,
'event_types' => [
'<string>'
],
'receive_simulated_events' => true,
'purchase_date_start' => '2023-12-25',
'purchase_date_end' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"is_active\": true,\n \"event_types\": [\n \"<string>\"\n ],\n \"receive_simulated_events\": true,\n \"purchase_date_start\": \"2023-12-25\",\n \"purchase_date_end\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/webhooks/{webhook_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"is_active\": true,\n \"event_types\": [\n \"<string>\"\n ],\n \"receive_simulated_events\": true,\n \"purchase_date_start\": \"2023-12-25\",\n \"purchase_date_end\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/webhooks/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"is_active\": true,\n \"event_types\": [\n \"<string>\"\n ],\n \"receive_simulated_events\": true,\n \"purchase_date_start\": \"2023-12-25\",\n \"purchase_date_end\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"webhook_id": "<string>",
"name": "<string>",
"url": "<string>",
"is_active": true,
"event_types": [
"<string>"
],
"receive_simulated_events": true,
"purchase_date_start": "2023-12-25",
"purchase_date_end": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z"
}Subtotal Connector tool: update_webhook
The response is the updated webhook, in the same shape as List webhooks.
Access
Call this endpoint with your API key, or with a Subtotal Connector OAuth token that includeswebhooks:write. A token without webhooks:write receives 403 insufficient_scope. Partner app tokens don’t include it.
Example
Pause a webhook:curl --request PATCH 'https://api.subtotal.com/webhooks/01JA7Q2W3E4R5T6Y7U8I9O0P1A' \
--header "x-api-key: $SUBTOTAL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"is_active": false}'
- Fields you omit are left unchanged.
event_typesreplaces the subscribed events. Send the full list you want.- Send
nullforpurchase_date_startorpurchase_date_endto clear that bound. Other fields can’t benull. - A new
urlmust meet the same requirements as on create. - The signing secret doesn’t change.
Errors
| Status | When |
|---|---|
404 | No webhook with this webhook_id on your account |
422 | A URL that doesn’t meet the requirements, an unknown event type, an empty event_types list, null for a field other than a date bound, a name already used by another of your webhooks, or a date window whose start is after its end |
Path Parameters
Body
application/json
Omitted fields are unchanged; explicit null clears a purchase date bound.
Required string length:
1 - 64Maximum string length:
256Replaces the subscribed events.
Minimum array length:
1Response
Successful Response
A client webhook. The signing secret is never part of this shape.
Subscribed event names, e.g. purchase.created.
Also deliver events from the simulator.
Only purchases on or after this date; null = unbounded.
Only purchases on or before this date; null = unbounded.