# Event notifications
source: https://developer.mastercard.com/mastercard-supplier-payment-agent/documentation/use_cases/commercial-direct-payments/event-notifications/index.md

## Setting Up MTLS for event notifications {#setting-up-mtls-for-event-notifications}

To enable MTLS, ensure you must:

1. Have a Mastercard-trusted certificate authority (CA).
2. Request access to Key Management Portal in Mastercard Connect.
3. Load the XMLGW certificate details into the trust store.

## How event notifications work {#how-event-notifications-work}

Mastercard presents its client certificate when requested by the server to authenticate and establish a trusted connection before sending the notification to your event notification URL. Commercial Direct Payments sends notifications to your event notification URL when a Buyer Payment Agent creates a payment instruction or updates a payment instruction status. It also returns responses to all registration or discovery requests to your event notification URL.

You should provide the URL of the event notification during onboarding. An example event notification URL could be `https://companyname.com/bps/notifications`. When Commercial Direct Payments sends an event notification to your URL, Commercial Direct Payments expects and acknowledgement within three seconds. If Commercial Direct Payments does not receive an acknowledgement in three seconds, then Commercial Direct Payments retries to send the notification three times at regular intervals of three seconds. If you continue to not respond, then Commercial Direct Payments updates the status of the payment instruction to SPA_SYSTEM_ERROR.

Each event notification has an event type to identify the data within the notification. The data schema changes based on the event type.

![alt text](https://static.developer.mastercard.com/content/mastercard-supplier-payment-agent/uploads/webhooknotification.png "Event Notification Structure")

All Commercial Direct Payments use cases use the below event notification payload structure. The data object schemas will differ based on the event type. Please refer to the use case section for the schemas.
* JSON

```JSON
{
  "eventId": "string",
  "eventType": "string",
  "eventCreatedDate": "datetime",
  "data": {
          }
}
```

