Skip to content

Sofort

Last updated: 14th 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.


Overview

You process a Sofort payment in two steps:


Request a payment

Use the details below to set up your request. To get a detailed view of all required and optional fields, see our API reference.

Endpoints

    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

    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"
    }
    }
    }

    If you receive a 202 Success response with a payment id and a status field set to Pending, your request was successful.


    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. To get a detailed view of all required and optional fields, see our API reference.

    Endpoints

      get

      https://api.checkout.com/payments/{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 Dashboard or using the refund endpoint of the Unified Payments 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.

        WebhookDescription

        payment_pending

        Occurs when a payment request has successfully initiated.

        payment_declined

        Occurs when a payment is declined.

        payment_expired

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

        payment_capture_pending

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

        payment_captured

        Occurs when a capture is successful.

        payment_canceled

        Occurs when the customer has canceled the payment or the payment has failed.

        payment_refunded

        Occurs when a refund is successful.

        payment_refund_declined

        Occurs when a refund is declined.


        Testing Sofort

        To start testing, you'll need to contact your Customer Success Manager or Implementations 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

        The payment remains in a deferred capture state. To test a full capture, contact us at integration@checkout.com to request that a transaction be manually set to captured.