logo
Trustly Docs
BETA

Notifications for DirectCredit

Updated 1 day ago

Overview

Notifications for the direct credit. Please note that the debit/credit notifications should be treated differently than for direct-debit. For a successful credit, a debit notification is sent. If the funds would come back, the credit notification will be emitted for the direct credit order.

Pending

Immediately after the direct-credit has been accepted for processing, a pending notification is sent to the NotificationURL.

Example request

JSON
{
    "method": "pending",
    "params": {
        "uuid": "258a2184-2842-b485-23ca-293425152415",
        "data": {
            "orderid": "87654567",
            "messageid": "98348932",
            "notificationid": "4876513450",
            "amount": "98.02",
            "currency": "GBP",
            "timestamp": "2010-01-20 14:42:04.675645+01"
        },
        "signature": "fVhjuMqbsH0Ku ... S16VbzRsw=="      
    },
    "version": "1.1"
}

Cancel

If the direct-debit could not be processed, a cancel notification is sent.

Example request

JSON
{
    "method": "cancel",
    "params": {
        "uuid": "258a2184-9021-b874-21ca-293425152415",
        "data": {
            "orderid": "87654567",
            "messageid": "98348932",
            "notificationid": "4876513450",
            "attributes": {
            	"reason": "",
            	"details": "",
            }
        },
        "signature": "F6+hjuMqbsH0Ku ... S16VbzRsw==",      
    },
    "version": "1.1"
}

Debit

Once the direct-credit has been successfully processed, a debit notification is sent for the same order. This basically means that the funds where deducted from the merchants account.

Example request

JSON
{
    "method": "debit",
    "params": {
        "uuid": "258a2184-2842-b485-25ca-293525152425",
        "data": {
            "orderid": "87654567",
            "messageid": "asdfasdasdf",
            "notificationid": "9876543456",
            "amount": "90.02",
            "currency": "GBP",
            "messageid": "98348932",
            "timestamp": "2010-01-20 14:42:04.675645+01",
            "attributes": {
            	"reference": "TRLY80494-1001",
            	"statement": "TRLY80494-1001",
            	"reason": "FAILED",
            	"details": ""              
            }
        },
        "signature": "D67hjuMqbsH0Ku ... S16VbzRsw==",      
    },
    "version": "1.1"
}

Credit

If the funds where sent, but later returned, a credit notification is sent for the order.

Example request

JSON
{
    "method": "credit",
    "params": {
        "signature": "D67hjuMqbsH0Ku ... S16VbzRsw==",
        "uuid": "258a2184-2842-b485-25ca-293525152425",
        "data": {
            "orderid": "87654567",
            "messageid": "98348932",
            "notificationid": "9876543456",
            "amount": "90.02",
            "currency": "GBP",
            "timestamp": "2010-01-20 14:42:04.675645+01",
            "attributes": {
            	"reference": "TRLY80494-1001",
            	"statement": "TRLY80494-1001"
            }
        }
    },
    "version": "1.1"
}