Paddle.Webhook (paddlex v0.2.0)

Copy Markdown View Source

Retrieve past events and alerts that Paddle has sent to your registered webhooks.

Summary

Functions

Retrieve past events and alerts that Paddle has sent to webhooks on your account

Types

t()

@type t() :: %Paddle.Webhook{
  alert_name: String.t(),
  attempts: integer(),
  created_at: String.t(),
  fields: map(),
  id: integer(),
  query_tail: String.t(),
  status: String.t(),
  updated_at: String.t()
}

Functions

get_history(params \\ %{}, opts \\ [])

@spec get_history(
  params,
  keyword()
) :: {:ok, t()} | {:error, Paddle.Error.t()}
when params: %{
       optional(:page) => integer(),
       optional(:alerts_per_page) => String.t(),
       optional(:query_head) => String.t(),
       optional(:query_tail) => String.t()
     }

Retrieve past events and alerts that Paddle has sent to webhooks on your account

Strongly recommended to utilize query_head and query_tail to limit your search to no more than any 24-hour period when calling this API. This ensures that the API response time remains quick and consistent as the amount of events/alerts build up over time.

Paddle.Webhook.get_history() 
{:ok, %{
  current_page: 1,
  total_pages: 46,
  alerts_per_page: 10,
  total_alerts: 460,
  query_head: ~U[2015-07-17 14:04:06Z],
  data: [
    %Paddle.Webhook{
      id: 22257,
      alert_name: "payment_refunded",
      status: "success",
      created_at: ~U[2015-07-17 14:04:05Z],
      updated_at: ~U[2015-08-14 13:28:19Z],
      attempts: 1,
      fields: %{
        "order_id" => 384920,
        "amount" => "100",
        "currency" => "USD",
        "email" => "xxxxx@xxxxx.com",
        "marketing_consent" => 1
      }
    }
  ]
}}