Sofort
Last updated: April 29, 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.
Information
To start accepting Sofort payments, please contact your Account Manager.
Model | Collecting |
---|---|
Payment flow | Bank transfer |
Payment method type | Online banking |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
You process a Sofort payment in two steps:
You can find the full list, as well as complete request and response examples, in our API reference.
post
https://api.checkout.com/payments/
1{2"source": {3"type": "sofort"4},5"amount": 1000,6"currency": "EUR"7}
Information
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.
If a payment id
is returned, your request was successful.
1{2"id": "pay_ylcikkxovyjunekfu7a444mmvy",3"status": "Pending",4"customer": {5"id": "cus_izfg7cwguvxuhaquys6qtof2f4"6},7"_links": {8"self": {9"href": "https://api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy"10},11"redirect": {12"href": "https://sandbox.checkout.com/LP.Core/api/payment/108689"13}14}15}
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.
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}
1{2"id": "pay_ylcikkxovyjunekfu7a444mmvy",3"requested_on": "2018-11-22T15:58:35Z",4"source": {5"type": "sofort"6},7"amount": 100,8"currency": "EUR",9"payment_type": "Regular",10"status": "Pending",11"risk": {12"flagged": false13},14"customer": {15"id": "cus_izfg7cwguvxuhaquys6qtof2f4"16},17"_links": {18"self": {19"href": "https://api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy"20}21}22}
Sofort supports both partial and full refunds. You can refund a payment through the refund API.
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.
When using Sofort, you may receive the following webhooks.
Webhooks | Description |
---|---|
| Sent when a payment request is successfully initiated. |
| Sent when the customer has approved the payment on the banking page. |
| Sent when the payment has been successfully captured. |
| Sent when the payment has expired. (Sofort payments expire after two hours.) |
| Sent when a payment request has been rejected. |
| Sent when the customer has aborted the payment or the payment has failed. |
| Sent when the payment has been (fully or partially) refunded. |
| Sent when a refund has been declined. |
Note
To start testing, you'll need to:
- Create a test account
- Contact your Account Manager or Implementation Engineer to activate Sofort payments in the sandbox environment
- Create a Sofort transaction as above, and then follow the redirect link (to Sofort or Klarna's website)
- To simulate different payments from bank accounts in other countries, enter specific amounts into the Sofort payment form:
- German bank accounts:
88888888
(8x8
) - Belgium bank accounts:
999
(3x9
) - For all other countries:
00000
(5x0
) or select Demo Bank
- German bank accounts:
- You are then redirected to your predefined success URL