Pesquisar

Are you looking for test card numbers?

Would you like to contact support?

Atenção, esta página não se encontra disponível em Português
Marketpay icon

Configure notifications

Learn how to set up and test notifications.

All Platforms API create, update, and delete requests are asynchronous, so you must rely on notifications to know the final result of a request. These notifications are sent as webhooks to the corresponding URLs configured on your server.

On this page you'll learn how to:

  • Create a configuration for each notification type that you want to receive from Adyen for Platforms.
  • Get information about existing notification configurations.
  • Test your notification set up.
  • Update existing notification configurations.
  • Delete notification configurations.

You also need to accept each notification, to confirm that you've received it.

Create a notification configuration

To configure a notification, make a POST /createNotificationConfiguration call and pass the URL where the notifications should be sent and the notification types that you want to receive. You can also provide the message format, protocol, username, password, and other parameters, as shown in the example below.

Create notification configuration
curl https://cal-test.adyen.com/cal/services/Notification/v6/createNotificationConfiguration \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
  "configurationDetails":{
    "apiVersion": 6,
    "active": true,
    "description":"Your unique description",
    "eventConfigs":[
      {
        "eventType":"ACCOUNT_HOLDER_VERIFICATION",
        "includeMode":"INCLUDE"
      },
      {
      "eventType":"ACCOUNT_HOLDER_CREATED",
      "includeMode":"INCLUDE"
      }
    ],
    "notifyURL":"https://www.merchant-domain.com/notification-handler",
    "notifyUsername":"yourUsername",
    "notifyPassword":"yourPassword",
    "sslProtocol":"SSL"
  }
}'
Response
{
    "pspReference": "8515659468351668",
    "configurationDetails": {
        "active": true,
        "apiVersion": 5,
        "description": "Your unique description",
        "eventConfigs": [
            {
                "eventType": "ACCOUNT_HOLDER_VERIFICATION",
                "includeMode": "INCLUDE"
            },
            {
                "eventType": "ACCOUNT_HOLDER_CREATED",
                "includeMode": "INCLUDE"
            }
        ],
        "notificationId": 20272,
        "notifyURL": "https://www.merchant-domain.com/notification-handler",
        "sslProtocol": "SSLInsecureCiphers"
    }
}

Get a configuration

To get the details of a previously configured notification, make a POST /getNotificationConfiguration call and pass the notification ID as a parameter.

Get an existing configuration
curl https://cal-test.adyen.com/cal/services/Notification/v6/getNotificationConfiguration \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
   "notificationId":20272
}'
Response
{
   "pspReference":"9914734158490053",
   "configurationDetails":{
      "active":true,
      "apiVersion":5,
      "description":"Your unique description",
      "eventConfigs":[
         {
            "NotificationEventConfiguration":{
               "eventType":"ACCOUNT_HOLDER_VERIFICATION",
               "includeMode":"INCLUDE"
            }
         }
      ],
      "notificationId":2,
      "notifyURL":"https://www.merchant-domain.com/notification-handler",
      "sslProtocol":"SSL"
   }
}

Get a list of configurations

In addition, you can get a list of all configured notifications. For this, make the /getNotificationConfigurationList call and pass an empty request as a parameter.

Get all configurations
curl https://cal-test.adyen.com/cal/services/Notification/v6/getNotificationConfigurationList \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{ }'
Response
{
    "pspReference": "8815658961765256",
    "configurations": [
        {
            "active": true,
            "description": "TestNotif11",
            "eventConfigs": [
                {
                    "eventType": "ACCOUNT_HOLDER_VERIFICATION",
                    "includeMode": "INCLUDE"
                }
            ],
            "notificationId": 20052,
            "notifyURL": "https://www.merchant-domain.com/notification-handler",
            "sslProtocol": "SSLInsecureCiphers"
        },
        {
            "active": false,
            "apiVersion": 6,
            "eventConfigs": [
                {
                    "eventType": "TRANSFER_FUNDS",
                    "includeMode": "INCLUDE"
                },
                {
                    "eventType": "BENEFICIARY_SETUP",
                    "includeMode": "INCLUDE"
                }
            ],
            "notificationId": 20008,
            "notifyURL": "https://www.merchant-domain.com/notification-handler",
            "sslProtocol": "SSLInsecureCiphers"
        }
    ]
}

Update notification configurations

To change notification settings, make a POST /updateNotificationConfiguration call and pass new settings as its parameters. The notification to be updated is specified by the notificationId value.

Update a notification configuration
curl https://cal-test.adyen.com/cal/services/Notification/v6/updateNotificationConfiguration \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
   "configurationDetails":{
      "active":false,
      "apiVersion":6,
      "description":"new description799847",
      "eventConfigs":[
         {
               "eventType":"ACCOUNT_HOLDER_CREATED",
               "includeMode":"EXCLUDE"
         },
         {
           "eventType":"ACCOUNT_CREATED",
           "includeMode":"INCLUDE"
         }
      ],
      "notificationId":3,
      "notifyPassword":"testPassword2",
      "notifyURL":"https://www.merchant-domain.com/notification-handler",
      "notifyUsername":"testUserName2",
      "sendActionHeader":false,
      "sslProtocol":"SSL"
   }
}'
Response
{
   "pspReference":"9914734160470077",
   "configurationDetails":{
      "active":false,
      "apiVersion":5,
      "description":"new description799847",
      "eventConfigs":[
         {
               "eventType":"ACCOUNT_CREATED",
               "includeMode":"INCLUDE"
         },
         {
               "eventType":"ACCOUNT_HOLDER_CREATED",
               "includeMode":"EXCLUDE"
         }
      ],
      "notificationId":3,
      "notifyURL":"https://www.merchant-domain.com/notification-handler",
      "sslProtocol":"SSLInsecureCiphers"
   }
}

Delete notification configurations

If you no longer need some of configured notifications, delete them by making a POST /deleteNotificationConfigurations call. Notifications to be deleted are specified by the IDs in the notificationIds array.

Delete notification configuration
curl https://cal-test.adyen.com/cal/services/Notification/v6/deleteNotificationConfigurations \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
   "notificationIds":[ 11, 26 ]
}'
Response
{
   "pspReference":"9914713525761479"
}

Accept notifications

To confirm that you have received a notification, your server should acknowledge the notification with the response:

{
    "notificationResponse" : "[accepted]"
}

We use at-least-once delivery to ensure that your server has received a notification. If your server has not acknowledged a notification within 10 seconds we will queue all notifications to this endpoint. We'll then retry sending the notification until it is accepted. Once accepted, you'll receive all your queued notifications.

Retry attempts will happen regularly, at increasing time intervals:

  • 2 minutes
  • 5 minutes
  • 10 minutes
  • 15 minutes
  • 30 minutes
  • 1 hour
  • 2 hours
  • 4 hours

Retries then happen every 8 hours for the following 7 days.

Test a notification

To test a notification configuration, make a POST /testNotificationConfiguration call and pass a notificationId as a parameter. If you leave the eventTypes array empty, all the configured notification types will be generated.

Test notifications
curl https://cal-test.adyen.com/cal/services/Notification/v6/testNotificationConfiguration \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
   "eventTypes":[],
   "notificationId":10
}'
Response in case of successful test
{
   "pspReference":"9914734161240289",
   "errorMessages":[

   ],
   "eventTypes":[
      "ACCOUNT_HOLDER_CREATED"
   ],
   "exchangeMessages":[
      {
         "ExchangeMessage":{
            "messageCode":"Number",
            "messageDescription":"1"
         }
      },
      {
         "ExchangeMessage":{
            "messageCode":"Title",
            "messageDescription":"Test 1: Test_ACCOUNT_HOLDER_CREATED"
         }
      }
   ],
   "notificationId":10,
   "okMessages":[
      "ResponseCode: 200",
      "ResponseTime_ms: 6",
      "Output: {\"name\":\"[accepted]\"}"
   ]
}
Response in case of a failed test
{
   "pspReference":"9914734162410311",
   "errorMessages":[
      "Failed to send message. Error description: Not equiped to send com.adyen.services.marketplace.notification.event.account.AccountHolderVerificationNotification"
   ],
   "eventTypes":[
      "ACCOUNT_HOLDER_VERIFICATION"
   ],
   "exchangeMessages":[
      {
         "ExchangeMessage":{
            "messageCode":"Number",
            "messageDescription":"1"
         }
      },
      {
         "ExchangeMessage":{
            "messageCode":"Title",
            "messageDescription":"Test 1: Test_ACCOUNT_HOLDER_VERIFICATION"
         }
      }
   ],
   "notificationId":10,
   "okMessages":[

   ]
}

Próximos passos