logo
Trustly Docs
BETA

DirectDebitMandate

Updated 1 month ago

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.

Create a direct debit mandate. This will return a url that the end-user should be redirected to. Once the end-user completes the flow, the end-user will be redirected to the success-url and notifications will be sent accordingly. If done in a physical environment, an operator can collect the details on an iPad and start the setup process which the consumer can finish by reading the QR-Code with the camera on their mobile device to complete the setup of the mandate.

JSON
{
  "method": "DirectDebitMandate",
  "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",
        "Country": "GB",
        "Firstname": "Steve",
        "Lastname": "Smith",
        "Locale": "en_GB",
        "Email": "test@trustly.com",
        "MobilePhone": "+46709876543",
        "SuccessURL": "https://example.com/success",
        "FailURL": "https://example.com/fail",
        "AddressLine1": "74 Oxford Rd",
        "AddressLine2": "",
        "AddressCity": "Drighlington",
        "AddressPostalCode": "BD11 2YJ",
        "AddressCountry": "GB",
        "ReturnToAppURL": "yourCustomURLScheme://"
      }
    },
    "Signature": "Hh+sfaUnbtMKW[...]9YngA9bTpiqxw==",
    "UUID": "258a2184-2842-b485-25ca-293525152425"
  },
  "version": "1.1"
}

Please note that for native app integrations, append the query parameter "IsNative=true" to the url before launching it to make the application aware that it lives within a native app. Also, it's important that you do use the ReturnToAppUrl when creating the order and intend to use it in a native app.

JSON
{
    "result": {
        "signature": "R9+hjuMqbsH0Ku ... S16VbzRsw==",
        "uuid": "258a2184-2842-b485-25ca-293525152425",
        "method": "DirectDebitMandate",
        "data": {
            "orderid": "2190971587",
            "url": "https://checkout.trustly.com/mdd/checkout?sessionId=3f9.....377&orderId=8365631872"
        }
    },
    "version": "1.1"
}