curl --request PATCH \
--url https://api.newinvoice.dev/v1/webhook_endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled_events": [
"invoice.stamped",
"invoice.cancelled",
"invoice.stamp_failed"
]
}
'import requests
url = "https://api.newinvoice.dev/v1/webhook_endpoints/{id}"
payload = { "enabled_events": ["invoice.stamped", "invoice.cancelled", "invoice.stamp_failed"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled_events: ['invoice.stamped', 'invoice.cancelled', 'invoice.stamp_failed']
})
};
fetch('https://api.newinvoice.dev/v1/webhook_endpoints/{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.newinvoice.dev/v1/webhook_endpoints/{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([
'enabled_events' => [
'invoice.stamped',
'invoice.cancelled',
'invoice.stamp_failed'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.newinvoice.dev/v1/webhook_endpoints/{id}"
payload := strings.NewReader("{\n \"enabled_events\": [\n \"invoice.stamped\",\n \"invoice.cancelled\",\n \"invoice.stamp_failed\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.newinvoice.dev/v1/webhook_endpoints/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled_events\": [\n \"invoice.stamped\",\n \"invoice.cancelled\",\n \"invoice.stamp_failed\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.newinvoice.dev/v1/webhook_endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled_events\": [\n \"invoice.stamped\",\n \"invoice.cancelled\",\n \"invoice.stamp_failed\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "obj_2P9K3sample",
"url": "https://example.com/webhooks/invoice",
"enabled_events": [
"string"
],
"enabled": true,
"connect": true,
"livemode": false,
"metadata": {},
"created_at": "2026-07-10T18:25:43Z",
"updated_at": "2026-07-10T18:25:43Z"
}{
"type": "https://errors.invoiceapi.mx/auth_unauthorized",
"title": "Authentication required",
"status": 401,
"code": "auth.unauthorized",
"detail": "Missing or invalid API key.",
"remediation": "Send `Authorization: Bearer sk_test_...` (or sk_live_...) with a valid API key.",
"doc_url": "/docs/errors#auth-unauthorized",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/resource_not_found",
"title": "Resource not found",
"status": 404,
"code": "resource.not_found",
"detail": "No such id in this org + mode.",
"remediation": "Verify the id and that the key mode (test/live) matches the id.",
"doc_url": "/docs/errors#resource-not_found",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/request_validation_failed",
"title": "Request validation failed",
"status": 422,
"code": "request.validation_failed",
"detail": "One or more fields did not satisfy the schema.",
"remediation": "Fix the fields listed in `errors` and resubmit.",
"doc_url": "/docs/errors#request-validation_failed",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/rate_limit_exceeded",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limit.exceeded",
"detail": "Too many requests for this key + request class (reads and writes are limited separately).",
"remediation": "Back off and retry after the number of seconds in the Retry-After header; batch work or lower your request rate.",
"doc_url": "/docs/errors#rate_limit-exceeded",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/internal_error",
"title": "Internal server error",
"status": 500,
"code": "internal.error",
"detail": "An unexpected error occurred.",
"remediation": "Retry later; contact support with the request_id if it persists.",
"doc_url": "/docs/errors#internal-error",
"request_id": "req_2P9K3sample"
}Update a webhook endpoint
Change the delivery URL, replace the subscribed event types, pause/resume delivery, or update metadata. At least one field is required.
curl --request PATCH \
--url https://api.newinvoice.dev/v1/webhook_endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled_events": [
"invoice.stamped",
"invoice.cancelled",
"invoice.stamp_failed"
]
}
'import requests
url = "https://api.newinvoice.dev/v1/webhook_endpoints/{id}"
payload = { "enabled_events": ["invoice.stamped", "invoice.cancelled", "invoice.stamp_failed"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled_events: ['invoice.stamped', 'invoice.cancelled', 'invoice.stamp_failed']
})
};
fetch('https://api.newinvoice.dev/v1/webhook_endpoints/{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.newinvoice.dev/v1/webhook_endpoints/{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([
'enabled_events' => [
'invoice.stamped',
'invoice.cancelled',
'invoice.stamp_failed'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.newinvoice.dev/v1/webhook_endpoints/{id}"
payload := strings.NewReader("{\n \"enabled_events\": [\n \"invoice.stamped\",\n \"invoice.cancelled\",\n \"invoice.stamp_failed\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.newinvoice.dev/v1/webhook_endpoints/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled_events\": [\n \"invoice.stamped\",\n \"invoice.cancelled\",\n \"invoice.stamp_failed\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.newinvoice.dev/v1/webhook_endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled_events\": [\n \"invoice.stamped\",\n \"invoice.cancelled\",\n \"invoice.stamp_failed\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "obj_2P9K3sample",
"url": "https://example.com/webhooks/invoice",
"enabled_events": [
"string"
],
"enabled": true,
"connect": true,
"livemode": false,
"metadata": {},
"created_at": "2026-07-10T18:25:43Z",
"updated_at": "2026-07-10T18:25:43Z"
}{
"type": "https://errors.invoiceapi.mx/auth_unauthorized",
"title": "Authentication required",
"status": 401,
"code": "auth.unauthorized",
"detail": "Missing or invalid API key.",
"remediation": "Send `Authorization: Bearer sk_test_...` (or sk_live_...) with a valid API key.",
"doc_url": "/docs/errors#auth-unauthorized",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/resource_not_found",
"title": "Resource not found",
"status": 404,
"code": "resource.not_found",
"detail": "No such id in this org + mode.",
"remediation": "Verify the id and that the key mode (test/live) matches the id.",
"doc_url": "/docs/errors#resource-not_found",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/request_validation_failed",
"title": "Request validation failed",
"status": 422,
"code": "request.validation_failed",
"detail": "One or more fields did not satisfy the schema.",
"remediation": "Fix the fields listed in `errors` and resubmit.",
"doc_url": "/docs/errors#request-validation_failed",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/rate_limit_exceeded",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limit.exceeded",
"detail": "Too many requests for this key + request class (reads and writes are limited separately).",
"remediation": "Back off and retry after the number of seconds in the Retry-After header; batch work or lower your request rate.",
"doc_url": "/docs/errors#rate_limit-exceeded",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/internal_error",
"title": "Internal server error",
"status": 500,
"code": "internal.error",
"detail": "An unexpected error occurred.",
"remediation": "Retry later; contact support with the request_id if it persists.",
"doc_url": "/docs/errors#internal-error",
"request_id": "req_2P9K3sample"
}Authorizations
API key: Authorization: Bearer sk_test_... or sk_live_....
Headers
Pin a dated API release (Stripe-style). Omit to use the current version. An unknown value returns 400 request.invalid_version. Echoed back on every response.
"2026-07-10"
Connect: act on behalf of one of your connected accounts (its acct_…/org_… id). Omit to act as your own organization. Not honored on /v1/api_keys.
"org_2P9connectedacct"
Path Parameters
Webhook endpoint id, e.g. "we_2P9K3sample".
Body
New HTTPS delivery URL.
Replace the subscribed event types ("", "invoice.", or exact types).
1true pauses delivery to this endpoint; false re-enables it.
Merge patch: keys with an empty-string value are removed; others are upserted.
Show child attributes
Show child attributes
Response
Default Response
Always "webhook_endpoint".
webhook_endpoint Webhook endpoint id, e.g. "we_2P9K3sample".
HTTPS URL events are delivered to.
Subscribed event types ("*", namespace wildcards, or exact types).
False when the endpoint is paused (disabled).
True when this endpoint also receives connected-account events.
True if created with a live-mode key.
Integrator-owned key-value map echoed back.
Show child attributes
Show child attributes
Creation timestamp, ISO-8601 UTC.
Last-update timestamp, ISO-8601 UTC.