Skip to content

Using Hooks

Hooks, often called webhooks are a convenient way to receive notification when some events occur in your Tropipay account. These events can be for example: when a payment is completed or funds are guarded by Tropipay in a mediation paymentcard. You can use hooks instead of notificationUrl to verify payments.

Some supported events

These are some of the most important events that we can get via webhooks.

Event nameDescription
user_loginEvent launched once an user completes login on the TropiPay platform.
user_kycEvent launched once an user completes kyc process.
beneficiary_addedLaunched after new beneficiary is created.
beneficiary_updatedLaunched after a beneficiary is modified.
beneficiary_deletedLaunched after a beneficiary is deleted.
transaction_newCreate a new transaction
transaction_pendinginPending transaction to settle in the payment entity
transaction_chargedTransaction waiting to be sent
transaction_paidA transaction has been paid.
transaction_cancelledEvents launched when a transaction is cancelled
transaction_guardedUsed for mediation paymentcards
transaction_guarded_mediationUsed in mediation paymentcards
user_after_updateEvent launched after a user is updated.
transaction_completedEvent launched after transaction is completed. You can use this event to verify payments

Subscribe a Hook Event

tpp.hooks.subscribe({
eventType: "beneficiary_added",
target: "web",
value: "https://mysite/webhooks/beneficiary_added",
});

Modify a Hook Event

tpp.hooks.update("beneficiary_added", "web", "https://mysite/anotherroute/");

Get subscribed event(s) info

tpp.hooks.list();
// you can also specify what event you want to retrieve
tpp.hooks.list("beneficiary_added");

Clear a Hook Event

tpp.hooks.delete("beneficiary_added", "web");