Notifications
Notifying payers and merchants about certain events related to their transactions is a core element of the payments experience. For instance, when a chargeback occurs, merchants must take action or forfeit the funds. WePay’s notification APIs inform your platform when events occur, and enable your platform to collect data on notifications.
Configuring notifications
You have two options when configuring WePay notifications on your platform:
-
Default WePay emails + Notification APIs: WePay-branded emails are turned on by default for every platform. No further action is required for the emails. In addition, integrating with the notification APIs means WePay sends your platform a webhook when a notification occurs. Your platform can store and utilize that data for internal purposes.
-
Partner-branded emails + Notification APIs: Default WePay emails can be customized to match the look and feel of your platform. These emails are sent by WePay on behalf of your platform, but your application’s brand is front and center. In addition, integrating with the notification APIs means WePay sends your platform a webhook when a notification occurs. Your platform can store and utilize that data for internal purposes.
Notification APIs
Tip
The notification APIs enable your platform to gather data on notifications, but do not function as a replacement for WePay emails.
Subscribe and receive details on event topics (payment and account-related notifications) using the /notification_preference and /notification resources.
Events Topics
A topic is a specific notification event your platform can subscribe to. Visit the Event Topics section in the API Reference for more details.
Resources
Use the /notification_preference resource to subscribe your platform to event topics. Your platform will receive a webhook when a notification your platform is subscribed to occurs. Then, your platform uses the /notification resource to retrieve the notification details.
Visit the API Reference page on Notifications for more information on resources and calls.
Using notification APIs internally
Your platform can utilize the notification APIs for internal application purposes without restriction, as long as your users receive WePay emails.
For example, your platform may combine WePay emails with the notification APIs to collect data without building custom notifications. Let’s say you want partner-branded emails sent by WePay on your platform’s behalf, but still wish to integrate the notification APIs to receive alerts when certain events occur. In this example, your users are notified with partner-branded emails from WePay, while your platform utilizes the notification APIs for internal purposes.
Scenario
Your platform’s payers prefer to pay your merchants via Pay With Bank (ACH). You want to improve your platform’s payer experience by sending a custom notification to the payer when they choose to verify their bank account through micro-deposits. This custom notification has an embedded micro-deposit verification form that is hosted by your platform so the payer experience stays in your application.
- Make the /notification_preference/create call and set the topic parameter to
payment_bank.microdeposit_sent
.
- A payer starts the micro-deposit bank account verification flow. Your platform receives a webhook with a unique
notification_id
like3cca6454-b82d-4afb-9ca2-517ae528c5c7
.
- Retrieve notification details by calling the /notification resource. Use the webhook data you received in step 2 to construct this API call.
- In the response, you receive details alerting your platform that the payer wishes to verify their bank account via micro-deposits.
- Your platform sends a custom notification prompting your payer to verify the micro-deposits sent to their bank account. Your platform can verify the payer's micro-deposits using the /payment_bank/verify API call.