Important information

The API reference is now available here.
The deprecated API reference is available here.


Accept Unzer Direct Debit Secured with server-side-only integration

Build your own payment form to add Unzer Direct Debit Secured payment to the checkout page


Unzer Direct Debit Secured payment method works similarly to Unzer Direct Debit, it too requires the customer to input their IBAN on the merchants website. You can see an example of the Unzer Direct Debit Secured component on our demo page.

In order for the insurance provider to properly insure a payment, a customer resource should be passed along with the payment request. If you don’t already have a customer resource available, you can create an Unzer Direct Debit Secured UI with a customer form attached.

Before you begin

Step 1: Create a payment type resource
server side

Data for the payment type:

Payment dataDescription
iban (required)The IBAN of the customer

When creating the payment type Unzer Direct Debit Secured, you need to send a request to the Unzer API. The response contains an id , this is later referred to as typeId. You will need this typeId to perform the transaction.


// get the IBAN from your payment form.
$unzer = new Unzer('s-priv-xxxxxxxxxx', SupportedLocale::GERMAN_GERMAN);
$dss= $unzer->createPaymentType(new SepaDirectDebitSecured($iban));
// get the IBAN from your payment form.
Unzer Unzer = new Unzer("s-priv-xxxxxxxxxx");
SepaDirectDebitSecured sepaDirectDebitSecured1 = new SepaDirectDebitSecured(iban);

The response looks similar to the following example:

    "id": "s-dds-e37mxcqfq3jo",
    "method": "sepa-direct-debit-secured",
    "recurring": false,
    "geoLocation": {
        "clientIp": "",
        "countryIsoA2": "AT"
    "iban": "DE89370400440532013000",
    "bic": "COBADEFFXXX",
    "holder": ""

For a full description of Unzer Installment payment type creation, check the API reference.

Step 2: Make a payment
server side

Besides an always mandatory step of creating the paymentType resource Unzer SepaDirectDebitSecured requires also a Customer and Basket resource.

Create a customer resource

This step is only applicable if you didn’t create a customer resource so far on the client side.


  "birthDate": "1974-10-03",
  "customerId": "",
  "email": "",
  "firstname": "Max",
  "lastname": "Mustermann",
  "mobile": "+49123456879",
  "phone": "+49123456789",
  "salutation": "mr",
  "billingAddress": {
    "city": "Heidelpay",
    "country": "DE",
    "name": "Max Mustermann",
    "street": "Vangerowstr. 18",
    "zip": "69115"
  "shippingAddress": {
    "city": "Heidelpay",
    "country": "DE",
    "name": "Max Mustermann",
    "street": "Vangerowstr. 18",
    "zip": "69115"
$address = (new Address())
            ->setName('Max Mustermann')
            ->setStreet('Vangerowstr. 18')

$customer = (new Customer())
            ->setCompany('Unzer GmbH')
            ->setMobile('+49 123456789')
            ->setPhone('+49 123456789')

Address address = new Address();
  .setName("Max Mustermann")
  .setStreet("Vangerowstr. 18")
Customer customer = new Customer("Max", "Mustermann");

customer = unzer.createCustomer(customer);

For a full description of customer resource please refer to relevant Server-side integration documentation page: Manage customer (direct API calls), Manage customer (PHP SDK), Manage customer (Java SDK).

Create a basket resource

The Basket resource stores information about the purchased products, used vouchers, and the shipment costs.


  "amountTotalGross" : 200.00,
  "amountTotalDiscount" : 10.00,
  "amountTotalVat" : 33.33,
  "currencyCode" : "EUR",
  "orderId" : "Order-12345",
  "note" : "Test Basket",
  "basketItems" : [ {
    "basketItemReferenceId" : "Item-d030efbd4963",
    "unit" : "m",
    "quantity" : 10,
    "amountDiscount" : 10.00,
    "vat" : 0.2,
    "amountGross" : 200.00,
    "amountVat" : 33.33,
    "amountPerUnit" : 16.667,
    "amountNet" : 166.67,
    "title" : "SDM 6 CABLE",
    "subTitle" : "This is brand new Mid 2019 version",
    "imageUrl" : "",
    "type": "goods"
  } ]
$unzer = new Unzer('s-priv-xxxxxxxxxx');

$basketItem = (new BasketItem())
    ->setTitle('SDM 6 CABLE')
    ->setSubTitle('This is brand new Mid 2019 version')

$basket = (new Basket())
    ->setNote('Test Basket')

BasketItem basketItem = new BasketItem()
        .setTitle("SDM 6 CABLE")
        .setSubTitle("This is brand new Mid 2019 version")
        .setImageUrl(new URL(""))

Basket basket  = new Basket()
        .setNote("Test Basket")

Unzer unzer = new Unzer("s-priv-xxxxxxxxxx");

For a full description of basket resource, refer to the relevant server-side-integration documentation page: Direct API integration, PHP SDK integration, Java SDK integration.

Make a Charge transaction

Now, make a charge transaction with the SepaDirectDebitSecured resource that you created. With a successful charge transaction insured money is transferred from the customer to the merchant and a payment resource is created.

    "amount": "20",
    "currency": "EUR",
    "resources": {
        "customerId": "s-cst-6bd9ca06cc57",
        "basketId": "s-bsk-17620",
        "typeId": "s-dds-bchnzvfuecjm"
$unzer = new Unzer('s-priv-xxxxxxxxxx');
$sepa-direct-debit-secured = $unzer->fetchPaymentType('s-dds-bchnzvfuecjm');
$charge = $sepa-direct-debit-secured->charge(20.0, 'EUR', 's-cst-6bd9ca06cc57','s-bsk-17620');
Unzer unzer = new Unzer("s-priv-xxxxxxxxxx");
Charge charge = unzer.charge(20.00, Currency.getInstance("EUR"), "s-dds-bchnzvfuecjm", "s-cst-6bd9ca06cc57", "s-bsk-17620");

Step 3: Check status of the payment
server side

After that, you can fetch the payment details from the API, by using the resources.paymentId from the charge response above to handle the payment according to its status. If the status of the payment is completed , the payment process has been finished successfully and can be considered as paid. Check all possible payment states here.


    "id": "s-pay-41201",
    "state": {
        "id": 1,
        "name": "completed"
    "amount": {
        "total": "20.0000",
        "charged": "20.0000",
        "canceled": "0.0000",
        "remaining": "0.0000"
    "currency": "EUR",
    "orderId": "",
    "invoiceId": "",
    "resources": {
        "customerId": "s-cst-6bd9ca06cc57",
        "paymentId": "s-pay-41201",
        "basketId": "s-bsk-17620",
        "metadataId": "",
        "payPageId": "",
        "traceId": "e3e558163c1086a45bdcb8b8ce3f9df8",
        "typeId": "s-dds-bchnzvfuecjm"
    "transactions": [
            "date": "2021-05-10 15:37:37",
            "type": "charge",
            "status": "success",
            "url": "",
            "amount": "20.0000"

Step 4: Display the payment result
client side

Use the information from the Check status of the payment step to display the payment result to your customer.
This can be the success or error page of your shop. If something went wrong, you can use the client message from the API response and show it to the customer.

Manage payment
server side

For more details on managing Unzer Direct Debit Secured payments, such as refunding them, see Manage Unzer Direct Debit Secured payments.


We recommend subscribing to the payment event to receive notifications about any changes to the payment resource. As soon as the event is triggered you should fetch the payment and update the order status in your shop according to its status.


For more details on implementing webhooks to receive notifications, see Notifications page.

Error handling

All requests to the API can result in an error that should be handled. Refer to the Error handling guide to learn more about Unzer API (and other) errors and handling them.

Test & go live

You should always test your integration before going live. First perform test transactions using test data. Next, check against Integration checklist and Go-live checklist to make sure the integration is complete and you’re ready to go live.

See also