Ask for an invitation
Menu

Endpoint

Update a webhook endpoint

PATCH/v1/webhook_endpoints/{id}

Changes only the fields sent. In live mode a key cannot move an endpoint to another url: a body with url answers passkey_approval_required with reason webhook_dashboard_only and nothing changes, and the dashboard moves it with a passkey. A pause, Enable, or a change of events, description or metadata is the API's in both modes. Test mode is unchanged.

Scope a restricted key needs
webhooks:write
Publishable key
Not allowed: secret or restricted key only
Idempotency-Key
Not used. A PATCH is already safe to repeat.

Parameters

Parameters of Update a webhook endpoint
ParameterType and placeMeaning
idrequiredstringpathThe id of the endpoint.
Orrerie-VersionstringheaderAPI version date. Default: the version the key was created with. Example 2026-10-11.

Request body

A JSON object. The body is required. A field the call does not list is refused with parameter_unknown.

Request body of Update a webhook endpoint
FieldTypeMeaning
urlstringSee the rules above.
descriptionstringUp to 200 characters.
enabled_eventsarray of valuesEvent types, or ["*"]. Wildcards per family are allowed: order.*.
statusstringRe-enable a disabled endpoint or pause one. One of enabled, disabled.
metadataobjectYour own key-value data (rules in Metadata).

Example request

curl

curl -X PATCH https://api.orrerie.com/v1/webhook_endpoints/we_tx7j2vmn3r2px2vpwbtz5h7b \
  -H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled_events": [
    "*"
  ]
}'

JavaScript

const response = await fetch("https://api.orrerie.com/v1/webhook_endpoints/we_tx7j2vmn3r2px2vpwbtz5h7b", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "enabled_events": [
      "*"
    ]
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
console.log(result);

Python

import os
import requests

response = requests.patch(
    "https://api.orrerie.com/v1/webhook_endpoints/we_tx7j2vmn3r2px2vpwbtz5h7b",
    headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
    json={
        "enabled_events": [
            "*",
        ],
    },
    timeout=30,
)
result = response.json()
if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)

PHP

<?php
$request = curl_init('https://api.orrerie.com/v1/webhook_endpoints/we_tx7j2vmn3r2px2vpwbtz5h7b');
curl_setopt_array($request, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'enabled_events' => [
            '*',
        ],
    ]),
]);
$body = curl_exec($request);
if ($body === false) {
    throw new RuntimeException(curl_error($request));
}
$result = json_decode($body, true);
if (curl_getinfo($request, CURLINFO_HTTP_CODE) >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);

Responses

200 OK

The answer is the webhook_endpoint object. Headers: Orrerie-Request-Id.

Example response, 200

{
  "id": "we_tx7j2vmn3r2px2vpwbtz5h7b",
  "object": "webhook_endpoint",
  "livemode": true,
  "created": "2026-09-03T10:00:00.000Z",
  "url": "https://acme.example/webhooks/orrerie",
  "description": "Shop backend",
  "enabled_events": [
    "*"
  ],
  "status": "enabled",
  "disabled_reason": null,
  "api_version": "2026-10-11",
  "secret_last4": "k3Qw",
  "previous_secret_expires_at": null,
  "last_success_at": "2026-10-11T14:09:56.020Z",
  "last_failure_at": null,
  "metadata": {}
}

Any other status: an error

A status of 400 or above answers with the error object. Branch on its code, never on its message.

Errors

Beside the errors every call can answer with (a bad key, a missing scope, the rate limit), this call answers with:

Errors of Update a webhook endpoint
CodeHTTPMeaning
passkey_approval_required403The action can only be done by a signed-in member in the dashboard (settlement asset, key-holding roles, approvals). No API key can do it.