Handles Webhook Endpoint resource endpoints.
Endpoints
- POST /v1/webhook_endpoints - Create webhook endpoint
- GET /v1/webhook_endpoints/:id - Retrieve webhook endpoint
- POST /v1/webhook_endpoints/:id - Update webhook endpoint
- DELETE /v1/webhook_endpoints/:id - Delete webhook endpoint
- GET /v1/webhook_endpoints - List webhook endpoints
Webhook Endpoint Object
%{
id: "we_...",
object: "webhook_endpoint",
created: 1234567890,
url: "https://example.com/webhook",
secret: "whsec_...",
enabled_events: ["charge.succeeded", "customer.created"],
status: "enabled",
metadata: %{},
# ... other fields
}
Summary
Functions
Creates a new webhook endpoint.
Deletes a webhook endpoint.
Lists all webhook endpoints with pagination.
Retrieves a webhook endpoint by ID.
Updates a webhook endpoint.
Functions
@spec create(Plug.Conn.t()) :: Plug.Conn.t()
Creates a new webhook endpoint.
Required Parameters
- url - Webhook endpoint URL
- enabled_events - Array of event types to subscribe to
Optional Parameters
- metadata - Key-value metadata
- status - Initial status (default: "enabled")
@spec delete(Plug.Conn.t(), String.t()) :: Plug.Conn.t()
Deletes a webhook endpoint.
Returns a deletion confirmation object.
@spec list(Plug.Conn.t()) :: Plug.Conn.t()
Lists all webhook endpoints with pagination.
Parameters
- limit - Number of items (default: 10, max: 100)
- starting_after - Cursor for pagination
- ending_before - Reverse cursor
@spec retrieve(Plug.Conn.t(), String.t()) :: Plug.Conn.t()
Retrieves a webhook endpoint by ID.
@spec update(Plug.Conn.t(), String.t()) :: Plug.Conn.t()
Updates a webhook endpoint.
Updatable Fields
- url
- enabled_events
- metadata
- status