Handling notifications
Learn how to configure and manage notifications for transaction events in Blnk.
Overview
Blnk uses webhooks to send you real-time notifications about crucial transaction events happening in your ledger.
In this guide, you’ll learn how Blnk sends notifications and how to handle error notifications through Slack.
Supported events
Blnk sends webhook notifications for four main events in your Blnk Ledger.
-
transaction.applied
: This event is sent when a transaction has been processed and applied to the participating balances. It signifies the completion of a transaction’s lifecycle. See also → Record a transaction. -
transaction.inflight
: This event is sent when a transaction’s status has been updated toINFLIGHT
and is waiting for a certain condition to be met, as defined by your application. See also → Introducing Inflight. -
transaction.rejected
: This event is sent when a transaction is rejected because all of the conditions required to process it wasn’t met. -
balance.monitor
: This event is sent when a balance monitor has been triggered and the monitoring conditions set have been met. See also → Balance monitoring.
Each notification payload contains two main fields:
Field | Description | Type |
---|---|---|
event | Indicates the type of event, e.g., transaction.applied . | String |
data | Contains the transaction or balance monitoring payload, detailing the relevant information. | Object |
Handling error notifications
In addition to transaction events, Blnk also allows you send error notifications to Slack via a specified webhook provided by your Slack workspace. This is very useful for monitoring and quickly addressing issues that may arise during transaction processing.
To learn how to get your Slack webhook URL, go to: Slack API: Sending messages using incoming webhooks.
Configuring notifications in Blnk
To set up how you receive notifications from Blnk, you need to update your blnk.json
configuration file. This file allows you to specify the webhook URLs that Blnk sends notifications to — both for your application and Slack.
If you do not have a
blnk.json
file, please create a newjson
file — it contains essential settings for running your Blnk server.Next, copy & paste the configuration JSON into it. See also → Run Blnk server.
Update the notification
object as follows:
slack
:webhook_url
: The webhook URL provided by your Slack workspace.
webhook
:url
: Your application’s webhook URL where Blnk sends transaction event notifications to.headers
: Optional headers that you may need to include in the notification request to authenticate the message. This can include authentication tokens or content type specifications.
Below is an example of a notifications configuration:
See also
Getting started
Dive into the Blnk Ledger
Managing notifications
Set up how you receive notifications
Enable secure mode
Secure your Blnk server
Load testing with k6
Set up a load test for your server
Need help?
Are you stuck? Do you have a question that isn’t answered in this doc? Have you run into a problem you can’t solve? Want to file a bug report?
Join our Discord server and share your questions/thoughts with other developers building financial applications like you.
Was this page helpful?