Endpoint
Create a webhook endpoint
POST
/v1/webhook_endpointsIn live mode a key cannot add an endpoint: it answers passkey_approval_required with reason webhook_dashboard_only, and a live endpoint is added in the dashboard with a passkey. Test mode is unchanged. The signing secret is shown once: a replay of the same request answers the endpoint without secret.
- Scope a restricted key needs
webhooks:write- Publishable key
- Not allowed: secret or restricted key only
- Idempotency-Key
- Recommended. It makes a retry safe.
Parameters
| Parameter | Type and place | Meaning |
|---|---|---|
Orrerie-Version | stringheader | API version date. Default: the version the key was created with. Example 2026-10-11. |
Idempotency-Key | stringheader | Makes a retry safe. Kept 24 hours. 1 to 255 characters. |
Request body
A JSON object. The body is required. A field the call does not list is refused with parameter_unknown.
| Field | Type | Meaning |
|---|---|---|
urlrequired | string | See the rules above. |
description | string | Up to 200 characters. |
enabled_eventsrequired | array of values | Event types, or ["*"]. Wildcards per family are allowed: order.*. |
api_version | string | The version events are rendered in. Default: the creating key's version. |
metadata | object | Your own key-value data (rules in Metadata). |
Example request
curl
curl https://api.orrerie.com/v1/webhook_endpoints \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
-H "Idempotency-Key: 8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a" \
-H "Content-Type: application/json" \
-d '{
"url": "https://acme.example/webhooks/orrerie",
"description": "Shop backend",
"enabled_events": [
"order.paid",
"order.underpaid",
"order.overpaid",
"order.expired",
"refund.confirmed"
]
}'JavaScript
const response = await fetch("https://api.orrerie.com/v1/webhook_endpoints", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
"Idempotency-Key": "8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a",
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://acme.example/webhooks/orrerie",
"description": "Shop backend",
"enabled_events": [
"order.paid",
"order.underpaid",
"order.overpaid",
"order.expired",
"refund.confirmed"
]
}),
});
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.post(
"https://api.orrerie.com/v1/webhook_endpoints",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}", "Idempotency-Key": "8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a"},
json={
"url": "https://acme.example/webhooks/orrerie",
"description": "Shop backend",
"enabled_events": [
"order.paid",
"order.underpaid",
"order.overpaid",
"order.expired",
"refund.confirmed",
],
},
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');
curl_setopt_array($request, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
'Idempotency-Key: 8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://acme.example/webhooks/orrerie',
'description' => 'Shop backend',
'enabled_events' => [
'order.paid',
'order.underpaid',
'order.overpaid',
'order.expired',
'refund.confirmed',
],
]),
]);
$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
201 Created
The answer is the webhook_endpoint object. Headers: Orrerie-Request-Id.
Example response, 201
{
"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": [
"order.paid",
"order.underpaid",
"order.overpaid",
"order.expired",
"refund.confirmed"
],
"status": "enabled",
"disabled_reason": null,
"api_version": "2026-10-11",
"secret_last4": "k3Qw",
"previous_secret_expires_at": null,
"last_success_at": null,
"last_failure_at": null,
"metadata": {},
"secret": "whsec_EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAk3Qw"
}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:
| Code | HTTP | Meaning |
|---|---|---|
url_invalid | 400 | Not https, has credentials, is over 2,048 characters, or (webhooks) resolves to a private address. |
webhook_endpoint_limit_reached | 403 | 1 (Unverified) or 10 (Verified) endpoints per mode. |
event_type_unknown | 400 | An entry of enabled_events is not an event type. |
passkey_approval_required | 403 | The 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. |