Set up
Last updated: Oct 27th, 12:43am
You can use the steps in this section to ensure that your accounts and environment are set up to accept Klarna payments.
Prerequisite
A PayPal business account with Expanded Checkout enabled.
Set up sandbox account
- Sign up for a PayPal developer account. On successful signup, PayPal automatically creates your sandbox environment. The sandbox environment mimics real-world transactions and includes a business and personal account by default. Use the personal account to approve Klarna payments and the business account to receive money. You can create additional business and personal accounts as needed.
Set up the sandbox environment:
- Go to your PayPal developer account sandbox and toggle to Sandbox.
- Go to Apps & Credentials and select Create App.
- Enter your app name, set the Type to Merchant, choose the sandbox business account, and select Create App. The app details page will be displayed.
- Configure a webhook listener for the app and subscribe to events:
- In the app details page, go to Sandbox Webhooks.
- Select Add Webhook.
- Enter a Webhook URL (your server endpoint for PayPal notifications), select the events to subscribe to, and select Save.
The webhook listener is now configured, and a Webhook ID is displayed. Store the ID for verification in your app code. For more information, see Use webhooks.
- Retrieve sandbox app credentials: To integrate and test Klarna payments, you need the following sandbox credentials:
- Client ID: App identifier for authentication.
- Client Secret: App credential for authorization.
- To retrieve the sandbox credentials:
- Go to your PayPal developer account and switch to Sandbox.
- Go to Apps & Credentials > API Credentials > REST API apps.
- Copy the Client ID and Client Secret listed next to your app name and save them.
- Retrieve sandbox account credentials: To test your Klarna integration end-to-end, run your app, simulate a checkout flow, log in to your personal PayPal account to approve the Klarna payment, and confirm that money is received in your business PayPal account. You need sandbox login credentials for both accounts. For information on accessing or resetting these credentials, see Get sandbox account credentials.
- Set up the development environment.
Set up production business account
- Log in to the PayPal Developer Dashboard and switch to the Live environment.
- Go to Apps & Credentials and create a new app or select an existing app.
- In the app's Features tab, ensure Accept payments is enabled.
- Configure a webhook listener for the app and subscribe to events:
- On the app details page, go to Live Webhooks.
- Select Add Webhook.
- Enter your Webhook URL (the server endpoint where notifications from PayPal are sent), select the events the app wants to subscribe to, and select Save.
-
[Recommended] Subscribe to the following events:
- CHECKOUT.ORDER.APPROVED
- PAYMENT.AUTHORIZATION.CREATED
- PAYMENT.CAPTURE.COMPLETED
- PAYMENT.CAPTURE.DENIED
- Click Save. A Webhook ID will be generated.
The webhook listener is successfully configured, and a Webhook ID is displayed. You can store the ID and use it in your app code to verify the source sending messages to your listener. For more information on webhooks, see Use webhooks.
- Copy your Client ID and Secret for the live app.
- Enable Klarna for the production account.
Onboard Klarna payments
You can enable Klarna using one of the following methods:
Enable Klarna from your PayPal dashboard
If you have an eligible PayPal business account, you can enable Klarna directly from your dashboard:
- Log in to your PayPal business account.
- Go to Account Settings > Products & Services > Payment Methods.
- Find Klarna and select Get Started.
- Follow the on-screen prompts to complete onboarding and activate Klarna payments on your accounts.
Once enabled, go to Payment Options to manage your Klarna settings or continue integration.
Request approval to enable Klarna
If you don't see Klarna in your dashboard, request approval by visiting the links below:
- Sandbox: https://www.sandbox.paypal.com/unifiedonboarding/entry?country.x=
&products=KLARNA - Live: https://www.paypal.com/unifiedonboarding/entry?country.x=
&products=KLARNA
Klarna payments are activated after PayPal verifies eligibility and completes a compliance review.
Partner information - onboard merchants
As a partner, you can onboard your merchants so they can receive Klarna as a payment method. You can also build the onboarding process into your software.
Use a valid access token and send a POST request to /v2/customer/partner-referrals with all required request parameters to generate a sign-up link that directs your merchants to PayPal onboarding. Ensure to include your merchant's information in the API call to pre-fill the PayPal sign-up flow.
products to KLARNA. This is only supported with the v2 Partner Referrals API.- Sample request
- Sample response
1curl -v -X POST https://api-m.sandbox.paypal.com/v2/customer/partner-referrals \2 -H "Content-Type: application/json" \3 -H "Authorization: Bearer <Access-Token>" \4 -H "PayPal-Partner-Attribution-Id: <BN-CODE>" \5 -d '{6 "business_entity": {7 "business_type": { "type": "PRIVATE_CORPORATION" },8 "addresses": [9 {10 "address_line_1": "Parkstr. 22",11 "admin_area_1": "Province",12 "postal_code": "10439",13 "country_code": "DK",14 "type": "WORK"15 }16 ]17 },18 "email": "[email protected]",19 "preferred_language_code": "da-DK",20 "tracking_id": "testklarna123122",21 "partner_config_override": {22 "partner_logo_url": "https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_111x69.jpg",23 "return_url": "https://testklarna.com/merchantonboarded",24 "return_url_description": "the url to return the merchant after the PayPal onboarding process.",25 "action_renewal_url": "https://testklarna.com/renew-expired-url",26 "show_add_credit_card": true27 },28 "operations": [29 {30 "operation": "API_INTEGRATION",31 "api_integration_preference": {32 "rest_api_integration": {33 "integration_method": "PAYPAL",34 "integration_type": "THIRD_PARTY",35 "third_party_details": {36 "features": [37 "PAYMENT",38 "REFUND",39 "ACCESS_MERCHANT_INFORMATION"40 ]41 }42 }43 }44 }45 ],46 "products": [ "KLARNA" ],47 "legal_consents": [48 { "type": "SHARE_DATA_CONSENT", "granted": true }49 ]50 }'
Partner-specific information
- Pass the build notation (BN) code of the partner in the PayPal-Partner-Attribution-Id header for server-side calls to the Orders API. PayPal uses this information for reporting and tracking purposes. To find your BN code, see Code and Credential Reference.
| Parameter name | Description |
|---|---|
business_entityRequired, string |
Merchant's business details, including type and address. |
operationsRequired, array |
List of operations to perform, such as API integration preferences. |
legal_consentsRequired, array |
Consents received from the merchant. If SHARE_DATA_CONSENT is not granted, PayPal does not store the customer data.
|
productsRequired, array |
PayPal products to which the partner wants to onboard the customer. For Klarna payments, set it to KLARNA.
|
tracking_idstring |
Partner's unique identifier for this customer. Use this ID to track the status of your merchant as they complete onboarding. |