Optional
allowedShippingCountries?: Country[]A list of countries a partner ships to. If not provided Klarna will not limit the countries available in the shipping address selector in OPF review screen.
Optional
redirectUrl?: stringRedirection URL.
redirectUrl is required for the UI modes DEVICE_BEST and REDIRECT (see FlowInteractionMode).
For UI modes DEVICE_BEST or REDIRECT consumer will always be redirected to this URL after an authorization. For UI mode ON_PAGE consumer will only be redirected to the redirectUrl if it was provided. Any payment request update event handlers will run before redirection.
The URL supports placeholders variables, the variables will be replaced with the corresponding value before redirection. Placeholders are always encapsulated within single curly brackets ({}).
Available placeholders for the success redirection URL.
{klarna.payment_request.id}
- Replaced with the Payment Request ID{klarna.payment_request.state}
- Replaced with the Payment Request state, see PaymentRequestState for the state values.{klarna.payment_request.payment_confirmation_token}
- Replaced with the payment confirmation token.{klarna.payment_request.payment_reference}
- Replaced with your payment referenceThe values are all URL safe, or URL encoded before substitution.
Example
If you set this to https://partner.example/checkout-success?klarna_auth={klarna.payment_request.payment_confirmation_token}
and the payment confirmation token is cd227fcd-21ee-4903-89ed-bd694144009e
then the full redirection URL will be
https://partner.example/checkout-success?klarna_auth=cd227fcd-21ee-4903-89ed-bd694144009e
Optional
requestCustomerProfile?: CustomerProfileCollection[]The requested customer data will be available for reading under state_context object after a successful payment or preparation flow.
Note that you must have a valid purpose under GDPR or other relevant jurisdiction to request and process the identity information of the customer.
profile:name
- returns the family name and given nameprofile:email
- returns the email and its verification status.profile:phone
- returns the phone number and its verification status.profile:locale
- returns the locale.profile:billing_address
- returns the customer profile address.profile:country
- returns the country.profile:national_identification
- returns the national identification number.profile:date_of_birth
- returns the date of birth.Optional
requestShippingData?: ShippingCollection[]Instruct Klarna to collect a shipping address from the consumer during the payment flow.
If you enable this, you must read back and honour the shipping address returned in the payment request response.
SHIPPING_ADDRESS
- collects the shipping details including recipient name and shipping address.
SHIPPING_OPTION
- when provided shipping option selector will be displayed in KEC. This option is only available in ON_PAGE mode and it requires shipping event handlers to be implemented.
Shipping details if requested will be available under state_context.shipping
when the request is in state PREPARED, PENDING_CONFIRMATION, or AUTHORIZED
Configuration options for a payment request.