Sofort
Last updated: August 14, 2024
Note
We don't support any new integrations with Sofort. Sofort is now part of Klarna to streamline payments for a more efficient checkout process.
If you do not have an existing integration with Sofort, we recommend exploring an integration with Klarna.
Sofort enables customers to perform online purchases in Europe using their banking details.
When a customer successfully completes a purchase, they'll receive a transaction confirmation so you can start processing the order immediately.
Model | Collecting |
---|---|
Payment flow | Redirect |
Payment method type | Online banking |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
You process a Sofort payment in two steps:
Use the details below to set up your request. To get a detailed view of all required and optional fields, see 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.
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}
If you receive a 202 Success
response with a payment id
and a status
field set to Pending
, your request was successful.
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. To get a detailed view of all required and optional fields, see our API reference.
get
https://api.checkout.com/payments/{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 Dashboard or using the Refund API.
Information
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.
Webhook | Description |
---|---|
| Occurs when a payment request has successfully initiated. |
| Occurs when a payment is declined. |
| Occurs when the payment has expired. (Sofort payments expire after two hours.) |
| Occurs when the customer has approved the payment on the banking page. |
| Occurs when a capture is successful. |
| Occurs when the customer has canceled the payment or the payment has failed. |
| Occurs when a refund is successful. |
| Occurs when a refund is declined. |
Note
To start testing, you'll need to contact your Account Manager or Implementations 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
Note
The payment remains in a deferred capture state. To test a full capture, contact us at [email protected] to request that a transaction be manually set to captured.