The Webhooks resource: registering, listing, updating, and deleting webhook endpoint subscriptions.
This is distinct from Ramp.Webhooks, which verifies and decodes
inbound webhook deliveries -- this module manages which events get sent
where.
Known event types
"card.activated", "card.suspended", "card.terminated",
"limit.created", "limit.updated", "reimbursement.created",
"reimbursement.updated", "transaction.created",
"transaction.updated", "user.created", "user.updated",
"user.deactivated", "bill.created", "bill.updated",
"bill.payment.created", "receipt.created", "receipt.matched".
Summary
Functions
Registers a new webhook endpoint that will receive event_types at url.
Deletes a webhook registration.
Fetches a single webhook registration by ID.
Returns a lazily auto-paginating Stream of Ramp.WebhookSubscriptions.Registrations.
Fetches a single page of webhook registrations. See Ramp.Page.
Updates a webhook registration's URL, active status, and/or subscribed event types.
Types
@type list_opt() :: {:start, String.t()} | {:page_size, pos_integer()}
Functions
@spec create(Ramp.Client.t(), String.t(), [String.t()], keyword()) :: {:ok, Ramp.WebhookSubscriptions.Registration.t()} | {:error, Ramp.Error.t()}
Registers a new webhook endpoint that will receive event_types at url.
If you omit :secret_token, Ramp generates one for you and returns it in
the response -- capture it immediately (via the returned Registration's
secret_token) and store it securely; it's what you'll pass to
Ramp.Webhooks.construct_event/5 to verify deliveries.
@spec delete(Ramp.Client.t(), String.t()) :: :ok | {:error, Ramp.Error.t()}
Deletes a webhook registration.
@spec get(Ramp.Client.t(), String.t()) :: {:ok, Ramp.WebhookSubscriptions.Registration.t()} | {:error, Ramp.Error.t()}
Fetches a single webhook registration by ID.
@spec list(Ramp.Client.t(), [list_opt()]) :: Enumerable.t(Ramp.WebhookSubscriptions.Registration.t())
Returns a lazily auto-paginating Stream of Ramp.WebhookSubscriptions.Registrations.
@spec list_page(Ramp.Client.t(), [list_opt()]) :: {:ok, Ramp.Page.t(Ramp.WebhookSubscriptions.Registration.t())} | {:error, Ramp.Error.t()}
Fetches a single page of webhook registrations. See Ramp.Page.
@spec update(Ramp.Client.t(), String.t(), [update_opt()]) :: {:ok, Ramp.WebhookSubscriptions.Registration.t()} | {:error, Ramp.Error.t()}
Updates a webhook registration's URL, active status, and/or subscribed event types.