# Sofort for Unified Payments API > **Note** > > We do not 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](https://www.checkout.com/docs/payments/add-payment-methods/klarna.md). You process a Sofort payment in two steps: 1. [Request a payment](https://www.checkout.com/docs/payments/payment-methods/sofort.md#Request_a_payment) 2. [Redirect the customer](https://www.checkout.com/docs/payments/payment-methods/sofort.md#Redirect_the_customer) --- ## 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](https://api-reference.checkout.com/). ### Endpoints > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request example ```json { "source": { "type": "sofort" }, "amount": 1000, "currency": "EUR" } ``` > **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. ### Response example ```json { "id": "pay_ylcikkxovyjunekfu7a444mmvy", "status": "Pending", "customer": { "id": "cus_izfg7cwguvxuhaquys6qtof2f4" }, "_links": { "self": { "href": "https://{prefix}.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 are prompted 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, 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 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](https://api-reference.checkout.com/). ### Endpoints > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `GET` `https://{prefix}.api.checkout.com/payments/{id}` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/payments/{id}` ### Response examples **Pending** ```json withBorder={false} { "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://{prefix}.api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy" } } } ``` **Pending capture** ```json withBorder={false} { "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://{prefix}.api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy" } } } ``` **Captured** ```json withBorder={false} { "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://{prefix}.api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy" }, "actions": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_ylcikkxovyjunekfu7a444mmvy/actions" }, "refund": { "href": "https://{prefix}.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 [Dashboard](https://dashboard.checkout.com?fromURI=www.checkout.com) or using the [refund endpoint](https://api-reference.checkout.com/tag/Payments/#operation/refundAPayment) of the Unified Payments API. --- ## Cancel a payment > **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. --- ## Testing Sofort > **Note** > > To start testing, contact your account 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 > **Note** > > The payment remains in a deferred capture state. To test a full capture, [contact us](https://dashboard.checkout.com/support/new?topic=case_transactions&issue=case_transactions_issue_other) to request that a transaction be manually set to captured.