Webhook endpoints
Where we send events. The signing secret is shown once, when the endpoint is made or its secret is rotated.
List webhook endpoints
GET /v1/webhook_endpoints
Key scope webhooks:read
Newest first, 20 at a time. See pagination.
Query: limit, starting_after
curl "https://api.invoicing.respiresoft.com/v1/webhook_endpoints?limit=10" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints?limit=10", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints?limit=10");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("GET", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints?limit=10",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Retrieve webhook endpoint
GET /v1/webhook_endpoints/{id}
Key scope webhooks:read
curl "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("GET", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Create webhook endpoint
POST /v1/webhook_endpoints
Key scope webhooks:write. Send an Idempotency-Key header
| Field | Type | Meaning |
|---|---|---|
url required | string | https only in live mode. Public addresses only. |
events required | array | Names (invoice.paid), groups (invoice.*) or *. |
description | string |
curl -X POST "https://api.invoicing.respiresoft.com/v1/webhook_endpoints" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/webhooks/respiresoft","events":["invoice.paid","receipt.issued"]}'const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://example.com/webhooks/respiresoft",
"events": [
"invoice.paid",
"receipt.issued"
]
}),
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"url" => "https://example.com/webhooks/respiresoft",
"events" => [
"invoice.paid",
"receipt.issued",
],
]),
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"url": "https://example.com/webhooks/respiresoft",
"events": [
"invoice.paid",
"receipt.issued"
]
},
)
data = res.json()Update webhook endpoint
PATCH /v1/webhook_endpoints/{id}
Key scope webhooks:write
Send only what changes. POST to the same address works too.
| Field | Type | Meaning |
|---|---|---|
url | string | |
events | array | |
description | string | |
status | string | enabled or disabled. Enabling clears the failure count. |
curl -X PATCH "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/webhooks/respiresoft","events":["invoice.paid","receipt.issued"]}'const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://example.com/webhooks/respiresoft",
"events": [
"invoice.paid",
"receipt.issued"
]
}),
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"url" => "https://example.com/webhooks/respiresoft",
"events" => [
"invoice.paid",
"receipt.issued",
],
]),
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("PATCH", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
json={
"url": "https://example.com/webhooks/respiresoft",
"events": [
"invoice.paid",
"receipt.issued"
]
},
)
data = res.json()Delete webhook endpoint
DELETE /v1/webhook_endpoints/{id}
Key scope webhooks:write
curl -X DELETE "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("DELETE", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Rotate the signing secret
POST /v1/webhook_endpoints/{id}/rotate_secret
Key scope webhooks:write. Send an Idempotency-Key header
The answer has the new secret, once. The old secret keeps signing too for expires_in_hours (default 24, 0 to 168), so you can switch without a gap.
| Field | Type | Meaning |
|---|---|---|
expires_in_hours | integer | 0 to 168. |
curl -X POST "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/rotate_secret" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"expires_in_hours":24}'const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/rotate_secret", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"expires_in_hours": 24
}),
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/rotate_secret");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"expires_in_hours" => 24,
]),
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/rotate_secret",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"expires_in_hours": 24
},
)
data = res.json()Send a test event
POST /v1/webhook_endpoints/{id}/test
Key scope webhooks:write. Send an Idempotency-Key header
Sends webhook.test now and answers with the delivery. It ignores the event filter and is tried once.
curl -X POST "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/test" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/test", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/test");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/test",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
)
data = res.json()List deliveries
GET /v1/webhook_endpoints/{id}/deliveries
Key scope webhooks:read
Filter with ?status=pending, succeeded or dead.
curl "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/deliveries" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/deliveries", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/deliveries");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("GET", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/deliveries",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Replay all dead deliveries
POST /v1/webhook_endpoints/{id}/replay
Key scope webhooks:write. Send an Idempotency-Key header
Queues a fresh delivery for every dead delivery that was not replayed yet (the 500 oldest).
curl -X POST "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/replay" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/replay", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/replay");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/webhook_endpoints/ID/replay",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
)
data = res.json()Retrieve a delivery
GET /v1/webhook_deliveries/{id}
Key scope webhooks:read
curl "https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("GET", "https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Replay one delivery
POST /v1/webhook_deliveries/{id}/replay
Key scope webhooks:write. Send an Idempotency-Key header
Sends the same event again, with the same webhook-id, as a new delivery.
curl -X POST "https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID/replay" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)"const res = await fetch("https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID/replay", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID/replay");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/webhook_deliveries/ID/replay",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
)
data = res.json()