1.0.0
Type: Object
Type: Object
Type: Object
Type: Object
(String)
: The first name of the consumer
(String)
: The family name of the consumer
(String)
: The personal title (UK to be one of
['Mr', 'Ms', 'Mrs', 'Miss']
| DACH to be one of
['Herr', 'Frau']
| NL to be one of
[ 'Dhr.', 'Mevr']
)
(String)
: The email address of the consumer
(String)
: The first line of the street address of the consumer
(String)
: The second line of the street address of the consumer
(String)
: The postal code of the address of the consumer
(String)
: The city from the address of the consumer
(String)
: The region from the address of the consumer
(String)
: The country from the address of the consumer. ISO 3166 alpha-2.
(String)
: The phone number of the consumer
Type: Object
(String)
: Unique identifier of this attribute. E.g. 'clr_22' for a color attribute.
(String)
: This is a label that will be presented to the consumer when they will be asked to specify this attribute's value
(String)
: Unique identifier of the value of this product attribute
(String)
: The value presented to the consumer for selection for a specific product attribute
Type: Object
(String)
: The item type., e.g. physical
(String?)
: The article number, SKU or similar.
(String)
: The descriptive item name, maximum 255 characters.
(Number?)
: The Item quantity, non-negative, between 0 and 100000
(Number)
: The unit price including tax without applying discounts in minor units
(Number)
: The number, two implicit decimals
(Number?)
: The total amount includes tax and discount
(Number?)
: The discount amount in minor units, includes tax
(Number)
: The total tax amount in minor units
(String?)
: The URL to a product image
(InstantShopping~ProductIdentifiers?)
: Additional information identifying an item
(InstantShopping~ShippingAttributes?)
: The item shipping attributes
(String)
: Unique identifier of the product that is described in multiple variations in this 'items' list.
(Array<InstantShopping~ItemProductAttributeItem>)
: List of Product_Attributes objects, each describe every possible product variation as a unique combination of product attributes, e.g. color, size, material.
Type: Object
(InstantShopping~LoadSetupOptions)
: A set of options to setup the flow. Same as the custom data attributes of the container element.
(String)
: The locale to control the language of the UI. Defaults to
en
. According to RFC 1766.
(String)
: The purchase country, used to localize the experience. According to ISO 3166 alpha-2.
(Array<String>)
: The billing countries, used to set allowed billing countries. According to ISO 3166 alpha-2.
(String)
: The purchase currency, used to properly format the prices. According to ISO 4217.
(InstantShopping~MerchantUrls)
: An object of merchant urls*
(InstantShopping~Attachment)
: An object containing attachment definition. Additional purchase information required for some industries.*
(InstantShopping~BillingAddress?)
: The billing address of the consumer, if known to the integrator
(String?)
: Pass through field
(String?)
: Used for storing merchant's internal order number or other reference
(String?)
: Used for storing merchant's internal order number or other reference
(Array<InstantShopping~OrderLinesItem>)
: An array of Order Lines
(Array<InstantShopping~ItemsItem>?)
: An array of Items, as all potential product variations
(Array<InstantShopping~ShippingOptionsItem>?)
: An array of Shipping Options
(InstantShopping~StylingOptions?)
: Styling options
(InstantShopping~ShippingAttributes?)
: The order's shipping attributes
(InstantShopping~Validations?)
: Skip validations for given properties and render a disabled button
(InstantShopping~Tokenization?)
: Button configuration for tokenization use-cases (eg subscriptions)
(Array<InstantShopping~AdditionalCheckbox>?)
: Additional checkboxes that will be shown on the checkout page
Type: Object
Type: Object
Type: Object
(InstantShopping~SetupOptions)
: Setup information
Type: Object
(String)
: The order line type., e.g. physical
(String)
: The article number, SKU or similar.
(String)
: The descriptive item name, maximum 255 characters.
(Number)
: The Item quantity, non-negative, between 0 and 100000
(Number)
: The unit price including tax without applying discounts in minor units
(Number)
: The number, two implicit decimals
(Number)
: The total amount includes tax and discount
(Number?)
: The discount amount in minor units, includes tax
(Number)
: The total tax amount in minor units
(String)
: The URL to a product image
(InstantShopping~ProductIdentifiers?)
: Additional information identifying an order line
(InstantShopping~ShippingAttributes?)
: The order line shipping attributes
Type: Object
(String)
: The product's category path as used in the merchant's webshop. Include the full and most detailed category and separate the segments with ' > '
(String)
: The product's Global Trade Item Number (GTIN). Common types of GTIN are EAN, ISBN or UPC. Exclude dashes and spaces, where possible
(String)
: The product's Manufacturer Part Number (MPN), which - together with the brand - uniquely identifies a product. Only submit MPNs assigned by a manufacturer and use the most specific MPN possible
(String)
: The product's brand name as generally recognized by consumers. If no brand is available for a product, do not supply any value.
Type: Object
(String?)
: If having multiple buttons per page use this value to target a specific button.
Type: Object
Type: Object
Type: Object
(String)
: Id
(String)
: Name of the location
(InstantShopping~ShippingDeliveryDetailsPickupLocationAddress)
: Location adress
Type: Object
Type: Object
Type: Object
(String)
: Carrier product name
(String)
: Type of shipping class
(InstantShopping~ShippingDeliveryDetailsProduct)
: Upstream carrier product
(InstantShopping~ShippingDeliveryDetailsPickupLocation)
: The selected location for this shipping option
(InstantShopping~ShippingDeliveryDetailsTimeslot)
: The selected timeslot for this shipping option
(Number)
: The product's height as used in the merchant's webshop. Non-negative. Measured in millimeters.
(Number)
: The product's width as used in the merchant's webshop. Non-negative. Measured in millimeters.
(Number)
: The product's length as used in the merchant's webshop. Non-negative. Measured in millimeters.
Type: Object
(String)
: The option id, e.g. express
(String)
: The option name, e.g. EXPRESS 1-2 Days
(String)
: The helpful text, e.g. Delivery by 4:30 pm
(Number)
: The price including tax
(Number)
: The tax amount
(Number)
: The non-negative, in percent, two implicit decimals. i.e 2500 = 25%
(String?)
: The promotional text
(Boolean?)
: The flag to influence preselection,
(String?)
: One of PickUpStore | Home | BoxReg | BoxUnreg | PickUpPoint | Own
(InstantShopping~ShippingDeliveryDetails?)
: The delivery details for this shipping option
Type: Object
(String)
: Defines the colors of the button. One of 'klarna' | 'dark' | 'light'. Default is 'klarna'.
(String)
: Defines the type for the button. Each button type has different texts & adjustments. One of 'express' | 'buy' | 'pay' | 'click_and_collect' | 'donation'. Default is 'express'.
Type: Object
(InstantShopping~StylingOptionsTheme)
: Defines the specifics of the desired theme
Type: Object
Type: Object
(InstantShopping~SetupOptions)
: A set of options to setup the flow. Same as the custom data attributes of the container element.
(String)
: The locale to control the language of the UI. Defaults to
en
. According to RFC 1766.
(String)
: The purchase country, used to localize the experience. According to ISO 3166 alpha-2.
(Array<String>)
: The billing countries, used to set allowed billing countries. According to ISO 3166 alpha-2.
(String)
: The purchase currency, used to properly format the prices. According to ISO 4217.
(InstantShopping~MerchantUrls)
: An object of merchant urls*
(InstantShopping~Attachment)
: An object containing attachment definition. Additional purchase information required for some industries.*
(InstantShopping~BillingAddress?)
: The billing address of the consumer, if known to the integrator
(String?)
: Pass through field
(String?)
: Used for storing merchant's internal order number or other reference
(String?)
: Used for storing merchant's internal order number or other reference
(Array<InstantShopping~OrderLinesItem>)
: An array of Order Lines
(Array<InstantShopping~ItemsItem>?)
: An array of Items, as all potential product variations
(Array<InstantShopping~ShippingOptionsItem>?)
: An array of Shipping Options
(InstantShopping~StylingOptions?)
: Styling options
(InstantShopping~ShippingAttributes?)
: The order's shipping attributes
(InstantShopping~Validations?)
: Skip validations for given properties and render a disabled button
(Array<InstantShopping~AdditionalCheckbox>?)
: Additional checkboxes that will be shown on the checkout page
Type: Object
(InstantShopping~AllowEmpty)
: The object containing the properties to skip validations for
Load the Instant Shopping flow. Accepts setup options according to the schema and configures the button.
(InstantShopping~LoadOptions)
An optional set of loading options
(load~callback)
A function to be called when the loading is completed.
try {
Klarna.InstantShopping.load({}, function (callbackData) { console.log('Smoooth!') })
} catch (e) {
// Handle the error
}
Called with the result of the load
operation.
Successful -> { show_button: true }
Failed -> { show_button: false, error: { ... } }
Unregisters an event handler for the given eventName.
(String)
The name of the event from which you want to unsubscribe.
(off~eventHandler?)
The function that was previously registered for the
eventName
. Omit if you want to unregister
all
handlers for the
eventName
.
(InstantShopping~Options)
An optional set of options
var theEventHandler = function () { ... }
Klarna.InstantShopping.on('confirmation_displayed', theEventHandler)
// unregister this specific listener for confirmation_displayed
Klarna.InstantShopping.off('confirmation_displayed', theEventHandler)
// unregister _all_ listeners for confirmation_displayed
Klarna.InstantShopping.off('confirmation_displayed')
// Multiple buttons scenario: unregister _all_ listeners for confirmation_displayed for instance_id 'button-instance-6a2a0390'
Klarna.InstantShopping.off('confirmation_displayed', undefined, {setup: {instance_id: 'button-instance-6a2a0390'}})
Registers an event handler for the given eventName
. The events are triggered
internally in Klarna InstantShopping. The supported events are:
customer_country
, customer_region
, customer_postal_code
from billing address.from
which is the view that was showing before closing.
This may be specification
, identification
, checkout
, shipping
, payment
, error
.customer_country
, customer_region
, customer_postal_code
from billing address.customer_selected_shipping_option
, customer_country
, customer_region
, customer_postal_code
from shipping address.customer_order_lines
, customer_order_amount
, customer_order_tax_amount
from order.(String)
The name of the event to which you want to subscribe.
(on~eventHandler)
The function that should be called when the event is emitted.
(InstantShopping~Options)
An optional set of options
// register on confirmation_displayed event
Klarna.InstantShopping.on('confirmation_displayed', function () {
console.log('The smoooth confirmation view is displayed.')
})
// Multiple buttons scenario: register on buy_button_clicked for button with instance_id 'button-instance-6a2a0390'
Klarna.InstantShopping.on('buy_button_clicked', function () {
console.log('The smoooth buy button was clicked. This is event added to button-instance-6a2a0390 only')
}, {setup: {instance_id: 'button-instance-6a2a0390'}})
Called whenever the associated event is emitted inside Klarna InstantShopping.
(any)
The button key.
(any)
The environment. Currently supporting playground and production.
(any)
The region. Currently supporting eu and na.
(any)
Uuid representing the instant shopping flow.
(any)
Uuid representing the session. This id is valid until a purchase is completed.
(any)
The integration url.
(any)
The instance_id for the button.
any
:
undefined
Open the Instant Shopping flow.
It accepts a callback to notify that the flow has opened or has failed to open.
Make sure that Instant shopping load
has been executed before calling open
.
(InstantShopping~Options)
An optional set of options to be used with open
(open~callback)
A function to be called when the opening of the modal is completed.
try {
Klarna.InstantShopping.open()
} catch (e) {
// Handle the error
}
Called with the result of the open
operation.
Successful -> { show_fullscreen: true }
Failed -> { show_fullscreen: false, error: { ... } }
Updates the Instant Shopping flow.
Accepts setup options according to the schema and configures the button.
Make sure that Instant shopping load
has been executed before calling update
.
(InstantShopping~UpdateOptions)
An optional set of loading options
(update~callback)
A function to be called when the updating is completed.
BB
try {
Klarna.InstantShopping.update()
} catch (e) {
// Handle the error
}
Called with the result of the update
operation.
Successful -> { show_button: true }
Failed -> { show_button: false, error: { ... } }
Clear context if app ID has changed
(any)
(any)
(any)
any
:
context