Overview: Notifications
API methods with the input parameter NotificationURL
will send a UTF-8 encoded notification message using HTTPS POST to the specified NotificationURL
to inform the merchant about updates to the order (for example a "credit" notification will be sent for a Deposit to confirm that the payment is completed).
The listening service at the merchant’s server must be accepting HTTPS requests and capable of handling a JSON RPC call. Mixing POST and GET data is not supported so the NotificationURL
must not contain a "?" (question mark).
The structure of the notification message depends on the API method. A typical Credit notification could look like:
{
"method": "credit",
"params": {
"signature": "R9+hjuMqbsH0Ku ... S16VbzRsw==",
"uuid": "258a2184-2842-b485-25ca-293525152425",
"data": {
"amount": "902.50",
"currency": "EUR",
"messageid": "98348932",
"orderid": "87654567",
"enduserid": "32123",
"notificationid": "9876543456",
"timestamp": "2010-01-20 14:42:04.675645+01",
"attributes": {}
}
},
"version": "1.1"
}
If the notification was received successfully, the listening service must reply synchronously with a JSON RPC result according to:
{
"result": {
"signature": "Jd0hjufbsH0u ... S12Vbz0sw==",
"uuid": "258a2184-2842-b485-25ca-293525152425",
"method": "credit",
"data": {
"status": "..."
}
},
"version":"1.1"
}
If the notification could not be delivered due to communication problems or if the listening service did not reply with a valid response, Trustly's system will attempt to send the notification again (with the same notificationid
) until it has been successfully delivered.
If the merchant would receive a notification with a notificationid
that has already been processed, the notification shall not be processed again but the returned result.data.status must be the same as was returned the first time. This could for example happen if there is a network communication problem with the notification response.
Trustly's system will increase the time in between each retry according to the table below
Retry attempt | 1 | 2 | 3 | 4 | 5 | 6 | 7 to 87 |
---|---|---|---|---|---|---|---|
Delay | 5 sec | 15 sec | 45 sec | 15 min | 45 min | 90 min | 3 hours |
If the merchant's listening service has been down for a longer period and then been brought back online again, the merchant can request to send all undelivered notifications immediately, thus ignoring the delay until the next attempt. Such a request has to be ordered manually to Trustly's customer support.
Use notification tool and learn how a transaction status is communicated through notifications. See Notification tool.