cURL
curl --request POST 'https://api.integrateledger.com/v1/webhook-endpoints/we_123' \
-H "Authorization: Bearer $LEDGER_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"enabledEvents":["*"],"disabled":false}'import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.updateWebhookEndpoint({ id: "we_123", body: { enabledEvents: ["*"], disabled: false } });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.update_webhook_endpoint("we_123", enabled_events=["*"], disabled=False){
"object": "webhook_endpoint",
"id": "<string>",
"url": "<string>",
"description": "<string>",
"enabledEvents": [
"<string>"
],
"apiVersion": "<string>",
"status": "enabled",
"disabledReason": "failing",
"disabledAt": "<string>",
"failingSince": "<string>",
"livemode": true,
"environment": "sandbox",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "payload_too_large"
}{
"error": "rate_limited"
}Webhooks
Update a webhook endpoint
Change an endpoint’s URL, events or description, or turn it off and on.
POST
/
v1
/
webhook-endpoints
/
{id}
cURL
curl --request POST 'https://api.integrateledger.com/v1/webhook-endpoints/we_123' \
-H "Authorization: Bearer $LEDGER_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"enabledEvents":["*"],"disabled":false}'import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.updateWebhookEndpoint({ id: "we_123", body: { enabledEvents: ["*"], disabled: false } });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.update_webhook_endpoint("we_123", enabled_events=["*"], disabled=False){
"object": "webhook_endpoint",
"id": "<string>",
"url": "<string>",
"description": "<string>",
"enabledEvents": [
"<string>"
],
"apiVersion": "<string>",
"status": "enabled",
"disabledReason": "failing",
"disabledAt": "<string>",
"failingSince": "<string>",
"livemode": true,
"environment": "sandbox",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "payload_too_large"
}{
"error": "rate_limited"
}Send only the fields to change.
disabled: true stops deliveries; events that happen while it is off are not sent to it later.
After three days of failed deliveries Ledger turns an endpoint off (disabledReason: "failing"). Fix the receiver, then send disabled: false: deliveries that were still retrying resume, and new events are sent again.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Required string length:
1 - 64Pattern:
^we_[A-Za-z0-9]+$Body
application/json
Where Ledger sends events. Live and production endpoints must be public https:// URLs.
Required string length:
1 - 2048Example:
"https://example.com/webhooks/ledger"
Required array length:
1 - 50 elementsAn event type, or * for every event.
Available options:
*, customer.created, customer.deleted, subscription.created, subscription.updated, subscription.canceled, invoice.paid, credits.granted, balance.low, balance.depleted, checkout.completed, checkout.expired Maximum string length:
200true turns the endpoint off. false turns it back on, including after Ledger turned it off for failing.
Response
Endpoint updated
Available options:
webhook_endpoint Available options:
enabled, disabled Available options:
failing, manual, null Available options:
sandbox, live