Guides

Notifications

Notifications are sent to users when an event occurs in the system related to them. Notifications are sent to users via email.

Notification Types

Notifications are sent for the following events:

EventDescriptionDefault Recipient
INVOICE_APPROVAL_NEEDEDAn invoice is created and needs approvalThe designated approver(s) of the invoice
INVOICE_APPROVEDAn invoice is approvedInvoice Creator
INVOICE_REJECTEDAn invoice is rejectedInvoice Creator
INVOICE_SCHEDULEDAn invoice is scheduled for paymentNone
INVOICE_PENDINGAn invoice payment has initiatedNone
INVOICE_PAIDAn invoice is marked as paidInvoice Creator
INVOICE_CANCELEDAn invoice is marked as canceledNone
INVOICE_CREATEDA new invoice is created by any means (email, upload, etc.)None
INVOICE_EMAILEDA new invoice is emailed to the email inboxNone
INVOICE_FAILEDAn invoice payment failedInvoice Creator

Changing Notification Recipients

The default recipients for each notification type can be changed by updating the policy for that notification type. You can also do this using the Admin Dashboard

For example, to change the recipients of the INVOICE_APPROVED notification type to always notify any user with the role admin or bookkeeper

POST
1curl -X POST https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/notification-policy/INVOICE_APPROVED \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "additionalRoles": [
6 "admin",
7 "bookkeeper"
8 ],
9 "disabled": false
10}'

Disabling Notifications

To disable notifications for a notification type, set disabled to true in the request body. You can also do this using the Admin Dashboard

POST
1curl -X POST https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/notification-policy/INVOICE_APPROVED \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "additionalRoles": [],
6 "disabled": true
7}'

Per-User Notification Customizations

Disabling Notifications for a Specific User

To disable notifications for a specific user, set disabled to true in the request body. You can also do this using the Admin Dashboard

POST
1curl -X POST https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "disabled": true
6}'

Enable Daily Digest Email

If you want to send a dialy email with all the notifications grouped into a single email, you can enable digest for the user

POST
1curl -X POST https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "digest": true
6}'

Enable Individual Notification Emails

If you want to send an email for each notification, you can enable immediate for the user

You can enable both digest and immediate notifications at the same time!

Viewing Notifications for a User

To view notifications for a user, use the get all notifications endpoint.

GET
1curl https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notifications \
2 -H "Authorization: Bearer <token>"

Customizing Notifications

You can customize the link that is included in the notification email. The default link will open up an standalone web page that displays the Mercoa inbox and invoice. You can customize this link to point to your own website or application.

You can use the Admin Dashboard to customize the link, or you can use the update notification configuration endpoint to customize the link for a specific notification type.

If you want to customize the email template, please reach out to the Mercoa team!