Accept Sofort with server-side-only integration

Build your own payment form to add Sofort payment to the checkout page.


The Sofort payment method doesn’t require any input from the customer on your website. Once they select the products and click Pay, they are redirected to the Sofort page where they enter their bank details and complete the payment.

Before you begin

Step 1: Create a Payment Type resource
server side

When creating the payment type Sofort, you need to send an empty 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.

POST https://api.unzer.com/v1/types/sofort/

Body: {}
$unzer = new Unzer('s-priv-xxxxxxxxxx');

$sofort = new Sofort();
$sofort = $unzer->createPaymentType($sofort);
Sofort sofort = new Sofort();
Unzer unzer = new Unzer(new HttpClientBasedRestCommunication(), "s-priv-xxxxxxxxxx");
sofort = unzer.createPaymentType(sofort);

The response will look similar to the following example:

    "id": "s-sft-yntsk7ejz52s",
    "method": "sofort",
    "recurring": false,
    "geoLocation": {
        "clientIp": "",
        "countryIsoA2": "DE"

For more details on Sofort payment type creation, seeAPI reference.

Next steps

The next steps are the same as for the UI components integration, check Accept Sofort with UI Components from Step 2 onwards.