Tink.Webhooks (Tink v1.0.0)

Copy Markdown View Source

Webhook endpoint registration and management.

Requires webhook-endpoints scope.

Setup

{:ok, client} = Tink.Auth.client_credentials(scope: "webhook-endpoints")

{:ok, endpoint} = Tink.Webhooks.create(client, %{
  "url"           => "https://yourapp.com/tink/events",
  "enabledEvents" => [
    "account.updated",
    "credentials.updated",
    "transaction.updated",
    "consent.revoked"
  ]
})

Handling events

See Tink.WebhookHandler for event dispatch and Tink.WebhookVerifier for signature verification.

Summary

Functions

Create a webhook endpoint. Requires webhook-endpoints.

Delete a webhook endpoint. Requires webhook-endpoints.

Get a webhook endpoint by ID. Requires webhook-endpoints.

List all registered webhook endpoints. Requires webhook-endpoints.

Update a webhook endpoint. Requires webhook-endpoints.

Functions

create(client, params)

@spec create(Tink.Client.t(), map()) :: {:ok, map()} | {:error, Tink.Error.t()}

Create a webhook endpoint. Requires webhook-endpoints.

delete(client, endpoint_id)

@spec delete(Tink.Client.t(), String.t()) :: :ok | {:error, Tink.Error.t()}

Delete a webhook endpoint. Requires webhook-endpoints.

get(client, endpoint_id)

@spec get(Tink.Client.t(), String.t()) :: {:ok, map()} | {:error, Tink.Error.t()}

Get a webhook endpoint by ID. Requires webhook-endpoints.

list(client)

@spec list(Tink.Client.t()) :: {:ok, map()} | {:error, Tink.Error.t()}

List all registered webhook endpoints. Requires webhook-endpoints.

update(client, endpoint_id, params)

@spec update(Tink.Client.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Tink.Error.t()}

Update a webhook endpoint. Requires webhook-endpoints.