Skip to content

Sofort

Last updated: 6th July 2022

Start accepting payments using Sofort, a favorite payment method in Europe.

Sofort is a direct payment method allowing your customers to use only their online banking details. Shortly after making a purchase, they receive a transaction confirmation so you can start processing the order immediately.

To start accepting Sofort payments, please contact your Customer Success Manager.

Model

Collecting

Payment flow

Bank transfer

Payment method type

Online banking

One-step payment

Authorization

Capture

Refund

Partial refund

Chargeback

Recurring payment


Overview

You process a Sofort payment in two steps:


Request a payment

You can find the full list, as well as complete request and response examples, in our API reference.

    post

    https://api.checkout.com/payments/

    Request example

    1
    2
    3
    4
    5
    6
    7
    {
    "source": {
    "type": "sofort"
    },
    "amount": 1000,
    "currency": "EUR"
    }

    If a customer ID or email is not provided in the request, we automatically create a customer profile and return the customer id in the response.

    Response example

    If a payment id is returned, your request was successful.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
    "id": "pay_ylcikkxovyjunekfu7a444mmvy",
    "status": "Pending",
    "customer": {
    "id": "cus_izfg7cwguvxuhaquys6qtof2f4"
    },
    "_links": {
    "self": {
    "href": "https://api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy"
    },
    "redirect": {
    "href": "https://sandbox.checkout.com/LP.Core/api/payment/108689"
    }
    }
    }

    Redirect the customer

    Redirect your customer to the redirect link’s href in the above response. The redirect transfers the customer to their bank's website where they will be asked to enter their authorization details; if successful, the payment can be approved.

    Once completed, the customer is transferred to your predefined success or failure URL. Confirmation of a Sofort payment is communicated only through webhooks. When you receive a payment_captured webhook notification, the transaction has been completed successfully. Until the payment_captured webhook is received (response code 10000), all payments are labeled as Pending.


    Get details about a payment

    You can retrieve details about an existing Sofort payment with the following request.

    If the payment has been approved by a customer on the banking page, you’ll receive a payment_capture_pending webhook and the payment response will include the bic, iban, and account_holder_name fields.

    You can find the full list, as well as complete request and response examples, in our API reference.

      get

      https://api.checkout.com/payments/{payment_id}

      Response examples

        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        {
        "id": "pay_ylcikkxovyjunekfu7a444mmvy",
        "requested_on": "2018-11-22T15:58:35Z",
        "source": {
        "type": "sofort"
        },
        "amount": 100,
        "currency": "EUR",
        "payment_type": "Regular",
        "status": "Pending",
        "risk": {
        "flagged": false
        },
        "customer": {
        "id": "cus_izfg7cwguvxuhaquys6qtof2f4"
        },
        "_links": {
        "self": {
        "href": "https://api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy"
        }
        }
        }

        Refund a payment

        Sofort supports both partial and full refunds. You can refund a payment through the refund API.


        Cancel a payment


        If the customer cancels or fails to complete the transaction at any point after the payment is created, it will automatically be canceled, and we’ll send you a payment_canceled webhook.


        Webhooks

        When using Sofort, you may receive the following webhooks.

        WebhooksDescription

        payment_pending

        Sent when a payment request is successfully initiated.

        payment_capture_pending

        Sent when the customer has approved the payment on the banking page.

        payment_captured

        Sent when the payment has been successfully captured.

        payment_expired

        Sent when the payment has expired. (Sofort payments expire after two hours.)

        payment_declined

        Sent when a payment request has been rejected.

        payment_canceled

        Sent when the customer has aborted the payment or the payment has failed.

        payment_refunded

        Sent when the payment has been (fully or partially) refunded.

        payment_refund_declined

        Sent when a refund has been declined.


        Testing Sofort

        To start testing, you'll need to:

        • Create a test account
        • Contact your Customer Success Manager or Implementation Engineer to activate Sofort payments in the sandbox environment
        1. Create a Sofort transaction as above, and then follow the redirect link (to Sofort or Klarna's website)
        2. To simulate different payments from bank accounts in other countries, enter specific amounts into the Sofort payment form:
          • German bank accounts: 88888888 (8x 8)
          • Belgium bank accounts: 999 (3x 9)
          • For all other countries: 00000 (5x 0) or select Demo Bank
        3. You are then redirected to your predefined success URL