Event Patterns and Rules
Overview
Most of the time you would not want to process every single event that is sent to the Event Bridge. On the contrary you will likely prefer to filter a subset of event based on the attribute of the events. By utilizing rules you will be able to filter events using the event pattern below
Event Pattern
The event pattern being used as an example below would be a normal event pattern from the Paymongo Wallet, but do note that the event pattern might differ from integration to integration, such as integrations from your bank.
Your application can also put your own event into the event bridge using the PutEvent API
{
"id" : "d5e368c6-5077-40fc-bff3-5164617e42bc",
"direction" : "in",
"method" : "BIFAST",
"internal_bic" : "PAEYPHM2",
"internal_account_id" : "506285930632",
"resulting_account_balance" : 11000000,
"external_bic" : "BUSTIDJ1",
"external_account_number" : "770007888808",
"external_sender_name" : "VINCENT TJIANATTAN",
"external_reference_number" : "BF25070600395675",
"notes" : "TX1234567890",
"currency" : "IDR",
"amount" : 1000000,
"fees" : 0,
"metadata" : {
"transaction_purpose" : 2
}
}
The event above can be described as money into paymongo wallet event using BI-FAST from Krom Bank Indonesia with the account number of 770007888808.
With that in mind, you can create rules according to your business needs to trigger a workflow or notification.
For example, the following rule will match all transfer in from Krom Bank Indonesia with the account number of 770007888808 with amount bigger than or equal to 1 million IDR.
{
"direction": ["in"],
"internal_bic": ["PAEYPHM2"],
"internal_account_id" : ["506285930632"],
"external_bic": ["BUSTIDJ1"],
"external_account_number": ["770007888808"],
"currency": ["IDR"],
"amount": [ { "numeric": [ ">=", 1000000 ] } ]
}
You can fine tune your event rule to however you like, but it is best practice to have your event rule as precise as possible as we wanted to filter the exact event and not be triggered by other similar events.
Event Structure of a Paymongo Wallet
Name | Description |
---|---|
id | Internal PayMongo Wallet Transaction ID |
direction | Direction of money in respective to the wallet |
internal_account_id | PayMongo Wallet Account Number |
method | Method used
For example: |
external_terminal_id | BIC code of the external party |
external_account_number | External account number of the sender or receiver |
external_account_name | Sender's account name |
external_reference_number | Reference number from the switching system |
currency | Currency being used for the transaction |
amount | Transaction amount |
metadata | Other information attached, normally related to the switcher network |
Updated about 21 hours ago