Sofort

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

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

Overview

You process a Sofort payment in two steps:

  1. Request a payment
  2. Redirect the customer

Request a payment 

The POST request

Use the details below to set up your request.

Endpoints

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

Header parameter

HeaderValue

Authorization

REQUIRED

secret key

Use the valid secret key of your Checkout.com account. You can find this in the Hub.

Content-Type

REQUIRED

application/json

Body parameters

The table below describes the minimum recommended fields. You can find the full list, as well as complete request and response examples, in our API reference.

Field nameDescription

source

OBJECT

REQUIRED

Details about the payment source.

source.type

STRING

REQUIRED

The type of payment source. Set this to sofort.

amount

INTEGER

OPTIONAL

The payment amount.

currency

STRING

REQUIRED

The three-letter ISO currency code. Set this to EUR.

Request example

{
  "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.

The POST response

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

Response example

{
  "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 biciban, and account_holder_name fields.

The GET request

Endpoints

GEThttps://api.checkout.com/payments/{payment_id}
GEThttps://api.sandbox.checkout.com/payments/{payment_id}

Header and path parameters

HeaderValue

Authorization

REQUIRED

secret key

Use the valid secret key of your Checkout.com account. You can find this in the Hub.

Content-Type

REQUIRED

application/json
PathValue

payment_id

REQUIRED

The payment ID found in the response of the initial payment.

The GET response

Response example

{
  "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"
    }
  }
}
{
  "id": "pay_ylcikkxovyjunekfu7a444mmvy",
  "requested_on": "2018-11-22T15:58:35Z",
  "source": {
    "type": "sofort",
    "bic": "SFRTDE20XXX",
    "iban": "DE06000000000023456789",
    "account_holder_name": "Max Mustermann"
  },
  "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"
    }
  }
}
{
  "id": "pay_ylcikkxovyjunekfu7a444mmvy",
  "requested_on": "2018-11-22T16:04:35Z",
  "source": {
    "type": "sofort",
    "bic": "SFRTDE20XXX",
    "iban": "DE06000000000023456789",
    "account_holder_name": "Max Mustermann"
  },
  "amount": 100,
  "currency": "EUR",
  "payment_type": "Regular",
  "approved": true,
  "status": "Captured",
  "risk": {
    "flagged": false
  },
  "customer": {
    "id": "cus_izfg7cwguvxuhaquys6qtof2f4"
  },
  "_links": {
    "self": {
      "href": "https://api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy"
    },
    "actions": {
      "href": "https://api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy/actions"
    },
    "refund": {
      "href": "https://api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy/refunds"
    }
  }
}

Refund a payment

Sofort supports both partial and full refunds. You can refund a payment through the Hub or using 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.

WebhookDescription
payment_pending

Sent when a payment request has successfully initiated.

payment_declinedSent when a payment request has been rejected.
payment_expiredSent when the payment has expired. (Sofort payments expire after two hours.)
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_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_declinedSent 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 Integrations engineer to activate Sofort payments in the sandbox environment.
  • Also, if you want to test capturing a Sofort payment, you will need to contact us so we can manually trigger it in sandbox.
  1. Create a Sofort transaction as above, and then follow the redirect link to Sofort/Klarna's website.
  2. Into the Bank name, BLZ, IBAN or BIC field enter 88888888, and then click Next.
  3. Enter 88888888 in the Account number field, and 123456 in the PIN field. Click Next.
  4. Select any account on the next page and then click Next.
  5. Enter 12345 in the TAN field and click Next.
  6. You should then be redirected to your predefined success URL.

Can we help?

Thanks for using Checkout.com. If you need help or have a question, message our Support team at support@checkout.com.