Klarna Web SDK v2/r8
    Preparing search index...

    Interface PaymentRequestData

    Request for a purchase authorization.

    This is the authorization context to use for a normal purchase.

    interface PaymentRequestData {
        amount?: number;
        collectCustomerProfile?: (
            | "profile:name"
            | "profile:email"
            | "profile:phone"
            | "profile:locale"
            | "profile:billing_address"
            | "profile:country"
            | "profile:national_identification"
            | "profile:date_of_birth"
        )[];
        currency: string;
        customerInteractionConfig?: { returnUrl?: string };
        intent?: "authorization" | "preparation";
        paymentOptionId?: string;
        paymentRequestReference?: string;
        requestCustomerToken?: {
            customerTokenReference?: string;
            scopes: (
                | "payment:customer_present"
                | "payment:customer_not_present"
                | "customer:login"
            )[];
        };
        shippingConfig?: {
            mode: "EDITABLE"
            | "READ_ONLY";
            supportedCountries?: string[];
        };
        supplementaryPurchaseData?: SupplementaryPurchaseData;
    }
    Index

    Properties

    amount?: number

    Total payment amount.

    collectCustomerProfile?: (
        | "profile:name"
        | "profile:email"
        | "profile:phone"
        | "profile:locale"
        | "profile:billing_address"
        | "profile:country"
        | "profile:national_identification"
        | "profile:date_of_birth"
    )[]

    Configure if the customer profile data should be collected from the customer. The collected customer data will be available under stateContext.klarnaCustomer.customerProfile when the request is in state COMPLETED.

    Note that you must have a valid purpose under GDPR or other relevant jurisdiction to request and process the identity information of the customer. The collected details can only be used for the purpose of fulfilling the purchase.

    The following customer profile details can be collected:

    • profile:name - returns the family name and given name
    • profile: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.
    currency: string

    3-letter ISO 4217 currency code.

    customerInteractionConfig?: { returnUrl?: string }

    Configuration for customizing customer interaction with the payment flow.

    Type Declaration

    • OptionalreturnUrl?: string

      URL to redirect the customer after the payment flow is completed.

    intent?: "authorization" | "preparation"

    The intent of this payment request.

    gated

    paymentOptionId?: string

    Specifies a payment option to be pre-selected in the purchase flow.

    The available payment option id can be obtained from the OSM API.

    paymentRequestReference?: string

    Reference to the payment session or equivalent resource created on your side. This will be exposed in payment request webhooks (payments.v2.request.*) for the purpose of correlating your resource with the Klarna Payment Request.

    requestCustomerToken?: {
        customerTokenReference?: string;
        scopes: (
            | "payment:customer_present"
            | "payment:customer_not_present"
            | "customer:login"
        )[];
    }

    Request a customer token which allows the partner to act on-behalf of or charge the customer.

    The generated token will be available under stateContext.klarnaCustomer.customerToken when the request is in state COMPLETED

    Type Declaration

    • OptionalcustomerTokenReference?: string

      Partner reference to the customer token created on Klarna side. If provided, this reference will be exposed in webhooks related to changes to the customer token (e.g. token revoked) for the purpose of correlating your resource with the Klarna customer token.

    • scopes: ("payment:customer_present" | "payment:customer_not_present" | "customer:login")[]

      The scopes of the requested customer token. The scopes define the permissions of the token.

      payment:customer_not_present - Enables payment tokenization of the customer, allows you to charge for subscriptions and on-demand when the customer is not present. payment:customer_present - Enables tokenization of the customer, subsequent charges depending on risk assessment and the initially selected payment method might go through immediately or, in certain cases, require step-up. customer:login - Enables account linking for the customer that allows the partner to create future payment requests in a logged in state for the customer.

    gated

    shippingConfig?: {
        mode: "EDITABLE" | "READ_ONLY";
        supportedCountries?: string[];
    }

    Configure if the shipping details should be collected from the customer.

    If mode is set to EDITABLE then the shipping details will be collected from the customer and will be available under stateContext.shipping when the payment request is in state COMPLETED.

    If mode is set to READ_ONLY then the customer can only see the shipping details that are provided in the supplementaryPurchaseData.shipping[0] object without the ability to change them. The READ_ONLY mode will be supported in a future release.

    Type Declaration

    • mode: "EDITABLE" | "READ_ONLY"
    • OptionalsupportedCountries?: string[]

      A list of countries the goods can be shipped to. When not provided, Klarna will not limit the countries available in the shipping address selector.

      []
      
    supplementaryPurchaseData?: SupplementaryPurchaseData

    Supplementary purchase data.