//native
/**
* Delete Webhook Endpoint
* Delete a webhook endpoint; Stripe stops sending events to it.
*/
export async function main(auth: RT.Stripe, webhook_endpoint_id: string) {
const response = await fetch(
`https://api.stripe.com/v1/webhook_endpoints/${webhook_endpoint_id}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
"Stripe-Version": "2025-03-31.basil",
},
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 3 hours ago