Nombaone.WebhookEvent (Nomba One v0.1.0)

View Source

A verified, parsed webhook delivery.

Fields:

  • id — the delivery reference (nbo…whd), unique per attempt-target.
  • type — the event type, e.g. "invoice.paid". Pattern-match on it.
  • event — a Nombaone.WebhookEvent.Ref — the underlying domain event. Dedupe on event.event.id (nbo…evt); delivery is at-least-once.
  • data — the event payload, a map with the wire's camelCase string keys, passed through verbatim (its shape depends on type).

Handling an event

case event.type do
  "invoice.paid" -> unlock(event.data["reference"])
  "invoice.action_required" -> email(event.data["checkoutLink"])
  "invoice.payment_failed" -> note(event.data["reason"])
  _ -> :ok
end

The type list is open — a type this SDK version does not know still parses. See types/0 for the documented catalog.

Summary

Functions

The documented webhook event types (32). The wire may emit others; those still parse.

Types

t()

@type t() :: %Nombaone.WebhookEvent{
  __raw__: term(),
  data: term(),
  event: term(),
  id: term(),
  type: term()
}

Functions

types()

@spec types() :: [String.t()]

The documented webhook event types (32). The wire may emit others; those still parse.