logo
Trustly Docs
BETA

ImportDirectDebitMandate

Updated 4 days ago

Overview

A mandate is a representation of an agreement between the end-user and the merchant for pulling funds out of the end-user's account based on the agreement for the service.

ImportDirectDebitMandate

Importing mandates is usually done when switching from one provider to Trustly and there are currently two scenarios supported, CREATE and REGISTER. The CREATE is used to get the information imported into Trustly's system which does not involve registering the mandate within the scheme. The REGISTER import is used when the mandate is to be re-registered within the scheme.

Notifications are sent in the same way as for creating mandates, eg account notifications and cancel notifications will/can be emitted for the order.

Please note that before importing mandates, you must speak to your account manager as this feature is only available when moving from one provider to another and by default this feature is not enabled.

Example request

JSON
{
  "method": "ImportDirectDebitMandate",
  "params": {
    "Data": {
      "Username": "merchant_username",      
      "Password": "merchant_password",
      "MessageID": "your_unique_order_id",
      "EndUserID": "unique_end_user_id",
      "NotificationURL": "https://URL_to_your_notification_service",
      "Attributes": {
        "AccountID": "12345678",
        "MerchantReference": "1234567890123",
        "ImportType": "CREATE",
        "Country": "GB",
        "Firstname": "Steve",
        "Lastname": "Smith",
        "Email": "test@trustly.com",
        "MobilePhone": "+46709876543",
        "AddressLine1": "74 Oxford Rd",
        "AddressLine2": "",
        "AddressCity": "Drighlington",
        "AddressPostalCode": "BD11 2YJ",
        "AddressCountry": "GB",
      }
    },
    "Signature": "Hh+sfaUnbtMKW[...]9YngA9bTpiqxw==",
    "UUID": "258a2184-2842-b485-25ca-293525152425"
  },
  "version": "1.1"
}

Example response

JSON
{
    "result": {
        "signature": "R9+hjuMqbsH0Ku ... S16VbzRsw==",
        "uuid": "258a2184-2842-b485-25ca-293525152425",
        "method": "ImportDirectDebitMandate",
        "data": {
            "orderid": "123123123",
            "result": "0" | "1",
            "rejected": "",
            "accountid": "123123123",
            "directdebitmandate" : "0",
            "bankcode" : "SWED",
            "descriptor": "******9736",
            "lastdigits": "9736",
            "bankidentifier": "85947",
            "clearinghouse": "Sweden",
            "bank": "Swedbank"
        }
    },
    "version": "1.1"
}