HPP (Hosted Paymet Page)
This guide covers everything you need to know to integrate Klarna HPP payments through the Ping Payments API.
Klarna HPP (Hosted Payment Page) is a full-page redirect payment experience hosted entirely by Klarna. The customer is redirected to Klarna's payment page to complete the purchase and then redirected back to your site. This means there is no iframe integration — the payment page cannot be embedded in your site. The entire checkout is handled on Klarna's domain.
Merchant Onboarding
Each merchant that will receive Klarna payments must be individually onboarded with Klarna. This process is handled by Ping Payments.
New Merchants
For merchants going through the KYC process, Klarna terms acceptance is included as part of the standard onboarding flow. No additional steps are required — once KYC is completed and Klarna terms are accepted, the merchant will be enabled for Klarna payments.
Existing Merchants
For merchants that are already onboarded with Ping Payments, a separate Klarna terms agreement will be sent. The merchant must accept these terms before they can be used for Klarna HPP payments.
Merchant Approval Status
Once a merchant has been onboarded with Klarna, their approval status is managed by Ping Payments.
The Designated Merchant
Every Klarna HPP payment requires a designated_merchant_id in the provider_method_parameters. This is the Ping Payments Merchant ID (UUID) of the merchant that the payment is processed through on Klarna's side.
Key points:
- The designated merchant must be Klarna-approved and not suspended.
- The designated merchant must appear in at least one of the payment's
order_items(i.e. themerchant_idof at least one order item must match thedesignated_merchant_id). - For payments involving multiple merchants, only one merchant is designated — this is the merchant whose Klarna account the payment session is created under.
Initiating a Payment
Use provider: "klarna" and method: "hpp" in the initiate payment request.
Required Parameters
| Parameter | Type | Description |
|---|---|---|
designated_merchant_id | string (uuid) | The Klarna-approved Ping Payments Merchant ID |
purchase_country | string | ISO 3166 alpha-2 country code (e.g. "SE") |
locale | string | Locale for the purchase (e.g. "sv-SE") |
redirect_urls | object | URLs for handling the payment flow outcome (see below) |
Redirect URLs
All five redirect URLs are required:
| Field | Description |
|---|---|
success | Redirect destination after successful payment |
cancel | Redirect destination when the customer cancels |
back | Redirect destination when the customer clicks/taps the back (X) button |
failure | Redirect destination when the payment fails |
error | Redirect destination when an error occurs |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
billing_address | KlarnaAddress | Customer's billing address |
shipping_address | KlarnaAddress | Customer's shipping address |
merchant_reference | string | Reference displayed to the customer in the Klarna app |
extra_merchant_data | object | Additional merchant data for risk assessment. May be required depending on the type of transactions being processed. |
hpp_options | object | Options for customizing the Klarna payment page |
HPP Options
The hpp_options object allows customization of the Klarna payment page:
| Field | Type | Description |
|---|---|---|
logo_url | string (uri) | URL of the logo to display |
page_title | string | Title for the payment page |
background_images | array | List of background images (with url, width, height) — best matching resolution is used |
purchase_type | string | Type of purchase: BUY, RENT, BOOK, SUBSCRIBE, DOWNLOAD, ORDER, or CONTINUE |
payment_method_categories | array | Payment method categories to show: DIRECT_DEBIT, DIRECT_BANK_TRANSFER, PAY_NOW, PAY_LATER, PAY_OVER_TIME, KLARNA. All categories are shown if omitted. |
show_subtotal_detail | string | Set to "HIDE" to hide the subtotal detail |
Supported Currencies
SEK, NOK, EUR, DKK
Payment Flow
- Initiate a payment — the response contains a
redirect_url. - Redirect the customer to the
redirect_urlto complete payment on Klarna's hosted page. - After the customer completes (or abandons) the payment, they are redirected to the corresponding redirect URL provided in the request.
- The payment status is delivered via the standard Ping Payments callback.
Example Request
{
"currency": "SEK",
"method": "hpp",
"order_items": [
{
"amount": 10000,
"merchant_id": "{{merchantId}}",
"name": "Product A",
"vat_rate": 25.0
}
],
"provider": "klarna",
"total_amount": 10000,
"provider_method_parameters": {
"designated_merchant_id": "{{merchantId}}",
"purchase_country": "SE",
"locale": "sv-SE",
"redirect_urls": {
"success": "https://example.com/success",
"cancel": "https://example.com/cancel",
"error": "https://example.com/error",
"back": "https://example.com/back",
"failure": "https://example.com/failure"
}
}
}Example Response
{
"id": "15c44587-7ebb-43a3-b437-8d00e5f8df7a",
"provider_method_response": {
"redirect_url": "https://payment.klarna.com/pay/abc123"
}
}Refunds
Klarna HPP payments support refunds through the standard Ping Payments refund flow. Refunds are processed immediately and are marked as completed upon initiation.
KlarnaAddress
The KlarnaAddress object is used for both billing_address and shipping_address:
| Field | Type | Description |
|---|---|---|
given_name | string | Customer's first name |
family_name | string | Customer's last name |
email | string | Customer's email address |
phone | string | Phone number (preferably mobile) |
street_address | string | Street address |
street_address2 | string | Street address, second line |
postal_code | string | Postal code |
city | string | City |
region | string | Region or state (mandatory for US and AU markets, ISO 3166-2 format) |
country | string | ISO 3166 alpha-2 country code |
title | string | Customer's title (country-specific, e.g. "Mr", "Ms") |
organization_name | string | Organization name (B2B only) |
attention | string | Attention line (B2B only) |
Updated about 16 hours ago