Event subscriptions and webhook management.
Subscriptions
{:ok, sub} = Lithic.Events.create_subscription(%{
url: "https://your-app.com/webhooks/lithic",
description: "Production webhook",
event_types: ["card.created", "transaction.settled"]
})Secret rotation
{:ok, secret} = Lithic.Events.get_subscription_secret(sub["token"])
{:ok, new_secret} = Lithic.Events.rotate_subscription_secret(sub["token"])Replay / Resend
{:ok, _} = Lithic.Events.resend_event(event_token, sub["token"])
{:ok, _} = Lithic.Events.replay_missing(sub["token"])
Summary
Functions
Replay all failed/missing messages to a subscription.
Resend a specific event to a subscription.
Resend failed message attempts for a subscription.
Send an example event of a given type to a subscription (for testing).
Functions
@spec create_subscription( map(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec delete_subscription( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec get_event( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec get_subscription( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec get_subscription_secret( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec list_events(keyword()) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
@spec list_message_attempts_for_event( String.t(), keyword() ) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
@spec list_message_attempts_for_subscription( String.t(), keyword() ) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
@spec list_subscriptions(keyword()) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
@spec replay_missing( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
Replay all failed/missing messages to a subscription.
@spec resend_event(String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}
Resend a specific event to a subscription.
@spec resend_failed( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
Resend failed message attempts for a subscription.
@spec rotate_subscription_secret( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec send_example(String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}
Send an example event of a given type to a subscription (for testing).
@spec stream_events(keyword()) :: Enumerable.t()
@spec update_subscription(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}