Klarna
An article about the payment method which allows to process payments by using bank transfers in different currencies in select European countries and supports purchases and refunds.
Overview
An article about the payment method which allows to process payments by using bank transfers in different currencies in select European countries and supports purchases and refunds.
Introduction
Klarna is a payment method which allows to process payments by using e-wallets in different currencies in different countries. This method supports one-step and two-step purchases as well as refunds.
Klarna is an omnichannel payment solution. Depending on the customer's market and eligibility, the following payment options can be offered to the customer to choose from (including options of the Buy Now Pay Later category):
- Pay in full—customer pays the amount in full immediately.
- Pay in 3—purchase is split into three interest-free payments charged automatically to the customer’s card on scheduled dates.
- Pay in 4—customer pays the first installment at purchase and the remaining three automatically every two weeks.
- Pay in 30 days—customer receives the goods or services immediately and makes a single payment within 30 days.
- Financing / Pay over time—longer-term installment financing, payments are made over several months.
Refer to your Ecommpay account manager for more details regarding these payment options.
This article provides information about working with the Klarna method: general insights are presented in the Overview section, while information about the actions required to process payments and perform other actions is presented in the sections that follow.
General information
| Payment method type | digital wallet payments |
|---|---|
| Payment instruments | digital wallets |
| Countries and regions | AT, AU, BE, CA, CH, CZ, DE, DK, ES, FI, FR, GB, GR, HU, IE, IT,MX, MX, NL, NO, NZ, PL, PT, RO, SE, SK, US |
| Payment currencies | EUR, AUD , CAD, CHF, CZK, DKK, GBP, HUF, MXN, NOK, PLN, NZD, RON, SEK, USD |
| Currency conversion | – |
| One-time purchases | + |
| Credential-on-file purchases | – |
| Full refunds | + |
| Partial refunds | + |
| Payouts | – |
| Chargebacks | + (via the Klarna merchant portal, details) |
| Notes |
|
| Onboarding and access fee | refer to your Ecommpay account manager |
Interaction diagram
Payment processing by using the Klarna method involves the merchant's web service, one of Ecommpay interfaces, the Ecommpay payment platform, and technical facilities of the provider service.
Operations support
Various platform interfaces can be used to process payments and perform operations using the Klarna method. Purchases can be processed by using Payment Page, Gate and Dashboard (using payment links), refunds—by using Gate and Dashboard. At the same time, regardless of the interfaces used, the following properties and limitations are applicable.
When working with the Klarna the following amount limits are applicable.
| Amounts (in suppored currencies) ¹ | Times ² | |||
|---|---|---|---|---|
| minimum | maximum | base | threshold | |
| Purchases | * | * | – | – |
| Refunds | – | – | – | – |
- The maximum amounts depend on banks.
- The base and threshold times are defined as follows:
- The base time is the average estimated time between the moment a payment is initiated in the payment platform to the moment the payment result is sent to the web service. The base time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (if any input from the customer is required). Use the base time to estimate when to react to the absence of payment result callbacks or when to check payment status (details).
- The threshold time is the maximum possible time between the moment a payment is initiated in the payment platform to the moment the web service receives the callback with the payment result. A payment is automatically assigned the
declinestatus if it wasn't processed within the threshold time. For individual customisation of the threshold time limit, contact Ecommpay technical support.
Processing scenarios
To perform a purchase by using the Klarna method, you need to redirect customer to the Klarna service, while to initiate a refund, you need to receive a request from the customer and notification from the web service side.
Scenarios for performing operations via the main interfaces of the payment platform correspond to those presented in the diagrams. Similarly, when additional features (such as payment links) are used, scenarios for performing operations also correspond to the specifics of those features.
Purchases by using Payment Page
General information
To process a purchase through Payment Page by using the Klarna method, the merchant web service is required to send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result. Klarna method allows customers to use the following payment options Pay in full, Pay in 3, Pay in 4, Pay in 30 days, Financing / Pay over time. The full sequence and special aspects of purchase processing are provided below.
- A customer initiates a purchase in the web service.
- The web service sends the request for opening Payment Page to the specified Ecommpay URL.
- The request for opening Payment Page is sent to the payment platform.
- The payment platform receives the request and validates the required parameters and signature.
- Payment Page is generated based on the project settings and parameters specified in the request.
- Payment Page is displayed to the customer.
- The customer selects the Klarna method.
- The request for processing the payment by using the Klarna method is received by the payment platform.
- The payment platform processes the request and sends it to the Klarna service.
- The request is processed on the side of the provider service.
- The data for redirecting the customer to the provider service is sent from the provider service to the payment platform.
- The data for redirecting the customer is sent from the payment platform to Payment Page.
- The customer is redirected to the provider service.
- The customer completes all required payment steps.
- The purchase is processed on the side of the provider service.
- The result information is displayed to the customer in the provider service.
- The customer is redirected to Payment Page.
- The provider service sends a notification about the result to the payment platform.
- The payment platform sends the payment result callback to the web service.
- The payment platform sends the result information to Payment Page.
- The result information is displayed to the customer on Payment Page.
Information about the formats of requests and callbacks used for processing payments by using the Klarna method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.
Request format
There are several things you need to consider when sending purchase requests by using the Klarna method:
- The following parameters required for any payment must be specified:
project_id—project identifier obtained from Ecommpay during integrationpayment_id—payment identifier unique within the projectpayment_currency—payment currency code in the ISO-4217 alpha-3 formatpayment_amount—payment amount in the smallest currency unitcustomer_id—customer identifier unique within the project
- To specify the type of purchase that is different from the default one set for the specific project, pass
sale(for immediate withdrawal of funds during one-step purchase processing) orauth(to place an authorisation hold during two-step purchase processing) in theoperation_typeparameter. - The following parameters required for any payment must be specified:
project_id,payment_id,payment_currency,payment_amount,customer_id. - Customer information must be specified using the following parameters:
identify_doc_number—identifier of the document serving as a proof of identity for the customer, the format depends on the customer's country of registration:- Sweden—Personal Identity Number of the form
YYYYMMDD-SSSS - Norway—National Identity Number of the form
DDMMYYIIIKK - Italy—Fiscal Code of the form
LLLLLLYYMMDDSSSC - Finland—Personal Identity Code of the form
DDMMYYCZZZQ - Spain—National Identity Document of the form
SSSSSSSSA - Denmark—Personal Identification Number of the form
DDMMYY-SSSS - USA—Social Security Number, consists of 9 digits
- Sweden—Personal Identity Number of the form
identify_doc_issue_country—code of the country where the document serving as a proof of the customer's identity was issued. Specified in the ISO 3166-1 alpha-2 formatcustomer_account_info—information about the customer's account and contact details obtained by the web service. Consists of a string obtained by encoding a JSON object using the Base64 encoding scheme. This object must include the following objects and parameters:account—object with the customer's account information kept on file by the merchant:date—account creation date in theDD-MM-YYYYformatloyalty_level—indicator of the customer's level in the merchant's web service loyalty program, converted to one of the following values (the parameter can be omitted if thepurchase_historyobject is included in theaccountobject):01—high02—medium03—low
purchase_history—array of objects containing information about the customer's previous purchases (the parameter can be omitted if thepurchase_historyobject is included in theaccountobject):number_of_purchases—number of purchases made in the last 12 monthsnumber_of_paid_purchases—number of paid purchases in the last 12 monthstotal_amount—total amount of purchases made in the last 12 months, in the smallest units of currency specified in thecurrencyparameter the same objectcurrency—currency code for the specified amount in the ISO-4217 alpha-3 formatpayment_method—indicator of the type of payment instrument used, can have one of the following values:01—payment card of the payment system via which the payment is initiated,02—account with support of direct debiting of funds,03—mobile wallet,04—payment card of another payment system,999—other instrumentfirst_purchase_at—date and time of the customer's first purchase in the web service in theDD-MM-YYYYhh:mmformatlast_purchase_at—date and time of the customer's first purchase in the web service in theDD-MM-YYYYhh:mmformat
purchase_data—information about line items in an order, consists of a string obtained by encoding a JSON object using the Base64 encoding scheme, and includes thepositionsarray and can include various combinations of elements from the list of supported data:positions—array, that contains information about line items, relevant to the purchase, must contain at least one object that includes the following parameters (for each item of goods or services):type—indicator that specifies the type of a line item, that can have one of the following values, defining the composition of the required parameters to be specified in thepositionsobject:discount—discount or promo code (for any goods or services),flight—air travel,car—car rental,bus—bus ride,ferry—ferry crossing,train—train ride,hotel—hotel accommodation,voucher—voucher or gift certificate,insurance—insurance,event—attending an event (for example a concert or exhibition),subscription—product or service provided as part of a subscription plan with regular debiting (for example, access to watching movies in an online cinema for a month),ondemand—product or service provided as part of an on-demand subscription plan (for example, watching a movie in an online cinema),marketplace—product or service provided via a marketplace,product—a product of a different category,service—a service of a different category,other—another type of service provided to the customername—name of the itemquantity—number of goods or services per itemamount_total—total cost of goods or services per item, in smallest currency units or as a hyphen (-) for items with thediscounttypeThe
product,service,discountandothertypes require only the parameterstype,name,quantityandamount_total.
- Whether the following parameters are required to be specified in the
positionsarray depends on the position type.Figure 5. flight departure—object that contains departure information:airport—three-letter code assigned to the departure airport by the International Air Transport Association (IATA)date—departure date in theDD-MM-YYYYformatcountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:airport—three-letter code assigned to the arrival airport by the International Air Transport Association (IATA)country—country code in the arrival address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
Figure 6. car departure—object that contains departure information:city—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:city—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
Figure 7. bus, train, ferry departure—object that contains departure information:date—departure date in theDD-MM-YYYYformatcity—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:city—name of the city in the arrival addresscountry—country code in the arrival address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
Figure 8. hotel hotel_name—name of the accommodation (for example, of a hotel or a hostel)start_date—service start date (for example, check-in date) in theDD-MM-YYYYformatend_date—service end date (for example, check-out date) in theDD-MM-YYYYformatcity—city name in the accommodation addresscountry—country code in the accommodation address in the ISO 3166-1 alpha-2 formatguests—array of objects containing information about guests:first_name—first name of the guestlast_name—last name of the guest
Figure 9. voucher start_date—start date of the voucher or certificate in theDD-MM-YYYYformatcompany—name of the organisation issuing the voucher or certificate
Figure 10. event event_type—event type indicator that can have one of the following values:CONCERT—concert,FESTIVAL—festival,TOUR—excursion or tour,IN_PERSON_EDUCATION—in-person educational event,DIGITAL_EDUCATION—online educational event,SPORT—sporting event,CONFERENCE—conference,EXPO—exhibition.start_date—event start date in theDD-MM-YYYYformatend_date—event end date in theDD-MM-YYYYformatcountry—country code in the event venue's address in the ISO 3166-1 alpha-2 format
Figure 11. subscription billing_plans, array of objects—array of objects containing subscription informationinterval, string—indicator that specifies the basic debiting period, can have one of the following values:DAY—dayWEEK—weekMONTH—monthYEAR—year
start_date, string,^\\d{2}-\\d{2}-\\d{4}$—debiting start date in theDD-MM-YYYYformat, starting from the day after the payment processing datefrequency, number—multiplier to increase the basic debiting period
Figure 12. ondemand interval, string—indicator that specifies debiting frequency, can have one of the following values:DAY—dayWEEK—weekMONTH—monthYEAR—year
frequency, number—multiplier to increase debiting frequency
Figure 13. marketplace seller—object containing information about the seller on the marketplace:name—name or title of the seller on the marketplacecity—name of the city where the seller is locatedcountry—country code of the seller's location in the ISO 3166-1 alpha-2 formatregistation—date of seller registration on the marketplace in theDD-MM-YYYYformat
product_category—product or service category indicator, can have one of the following values:ACCESSORIES—accessoriesAPPLIANCES—home appliancesAPPS_AND_GAMES—applications and gamesARTS_CRAFTS_AND_SEWING—arts and craftsAUTOMOTIVE—car productsBEAUTY—personal care productsBABY—children's productsBABY_CLOTHING—children's clothingBAGS_AND_PURSES—bags and pursesBOOKS—books and other printed publicationsCDS_AND_VINYL—compact discs, vinyl records, and other physical media audio recordingsCELL_PHONES_AND_ACCESSORIES—mobile phones and accessoriesCOLLECTIBLES_AND_FINE_ARTS—art and collectiblesDIGITAL_MUSIC—musical recordings in digital formatELECTRONICS—electronic devicesGROCERY_AND_GOURMET_FOOD—grocery and gourmet foodsHANDMADE—handmade productsHEALTH_AND_PERSONAL_CARE—health and personal care productsHOME_AND_KITCHEN—home and kitchen productsINDUSTRIAL_AND_SCIENTIFIC—industrial and scientific equipmentLUGGAGE_AND_TRAVEL_GEAR—luggage, travel accessories, and other travel productsMAGAZINE_SUBSCRIPTIONS—subscriptions to print or digital periodicalsMEN_CLOTHING—men's clothingMUSICAL_INSTRUMENTS—musical instrumentsOFFICE_PRODUCTS—office suppliesPATIO_LAWN_AND_GARDEN—patio and garden suppliesPET_SUPPLIES—pet suppliesSHOES—shoesSOFTWARE—softwareSPORTS_AND_OUTDOORS—sports and outdoor suppliesTOOLS_AND_HOME_IMPROVEMENT—construction tools and home improvement suppliesTOYS_AND_GAMES—toys and gamesVIDEO_GAMES—video gamesWOMEN_CLOTHING—women's clothing
additional_info—string object containing additional information that may be relevant for payment processing:integration_metadata, object—object containing information about how the payment was technically initiated:originators, array of objects—array of objects containing information about the components used to initiate the payment (on the merchant's web service; up to six objects):name, string—name of the service via which the payment was initiated, in the form of uppercase letters, digits, and underscores (_) instead of spaces (for example,COSMO_GAMES_STORE)module_name, string—name of the technical module via which the payment was initiated, for example,cosmoshopPluginmodule_version, string—version number of the technical module via which the payment was initiated, for example,2.1session_reference, string—identifier of the operation or session within the web service, as a universally unique identifier version 7 (UUIDv7) in accordance with RFC 9562, for example,018b163d-0b83-7ba0-b837-da575d0ff824
-
To ensure the user interface complies with Klarna service requirements, it is recommended to specify the payment form display language code in the
language_codeparameter and the customer address region code in theregion_codeparameter. The language code must be specified in accordance with the region code and the following compliance rules.Figure 14. List of supported languages for different region codes Region code Supported languages ATde,enAUenBEnl,fr,enCAen,frCHen,de,fr,itCZcs,enDEde,enDKda,enESes,enFIfi,sv,enFRfr,enGBenGRel,enHUhu,enIEenITit,enNLnl,enNOnb,nn,enNZenPLpl,enPTpt,enROro,enSEsv,enSKsk,enUSenIf the language code is not specified in the request or a code that does not comply with the provided rules is specified, the payment form is displayed using English for the main form elements and possibly using the primary national language for specific Klarna service elements, which may lead to a decrease in conversion rate.
- If you need to have the payment form displayed with the Klarna method selected, set the
force_payment_methodparameter toklarna. - Additionally, any other parameters available for working with Payment Page can be used (details).
- After all target parameters are specified, create a signature (details).
Thus, a correct request for opening the payment form using the Klarna method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer and line items information, as well as signature.
{
"project_id": 12345,
"payment_amount": 663800,
"payment_currency": "EUR",
"payment_id": "ORDER-20260309-0001",
"payment_description": "Order with 2 computers, 2 flight tickets and 1 event reservation",
"customer_id": "cust-9001001",
"customer_first_name": "John",
"customer_last_name": "Smith",
"customer_phone": "+31612345678",
"customer_street": "Herengracht",
"building_address": "101",
"customer_state": "NH",
"customer_email": "john@example.com",
"customer_city": "Amsterdam",
"region_code": "NL",
"language_code": "nl",
"customer_zip": "1015BG",
"customer_day_of_birth": "15-04-1985",
"identify_doc_number": "19850415-1234",
"doc_issue_country": "NL",
"customer_account_info": "eyJkYXRlIjoiMTAtMDItMjAyMSIsImNoYW5nZV9kYXRlIjoiMDiOnsibG95YWx0eV9sZXZlbCI6IkhJR0giLCJhdXRoX3RpbWUiOiIwOS0wMy0yMDI2MTA6MTUiLCJhdXRoX21ldGhvZCI6IlBBU1NXT1JEIn19",
"purchase_data": "eyJkYXRlIjoiMTAtMDItMjAyMSIsImNoYW5nZV9kYXRlIjoiMDEtMDMtMjAgiLCJhdXRoX3RpbWUiOiIwOS0wMy0yMDI2MTA6MTUiLCJhdXRoX21ldGhvZCI6IlBBU1NXT1JEIn18",
"additional_info":{
"integration_metadata":{
"originators":[{
"moduleName":"cosmoshopPlugin",
"moduleVersion":"2.1",
"name":"COSMO_GAMES_STORE",
"session_reference":"018b163d-0b83-7ba0-b837-da575d0ff824"
}]
}
}
}
{
"project_id": 12345,
"payment_amount": 663800,
"payment_currency": "EUR",
"payment_id": "ORDER-20260309-0001",
"payment_description": "Order with 2 computers, 2 flight tickets and 1 event reservation",
"customer_id": "cust-9001001",
"customer_first_name": "John",
"customer_last_name": "Smith",
"customer_phone": "+31612345678",
"customer_street": "Herengracht",
"building_address": "101",
"customer_state": "NH",
"customer_email": "john@example.com",
"customer_city": "Amsterdam",
"region_code": "NL",
"language_code": "nl",
"customer_zip": "1015BG",
"customer_day_of_birth": "15-04-1985",
"identify_doc_number": "19850415-1234",
"doc_issue_country": "NL",
"customer_account_info": "eyJkYXRlIjoiMTAtMDItMjAyMSIsImNoYW5nZV9kYXRlIjoiMDiOnsibG95YWx0eV9sZXZlbCI6IkhJR0giLCJhdXRoX3RpbWUiOiIwOS0wMy0yMDI2MTA6MTUiLCJhdXRoX21ldGhvZCI6IlBBU1NXT1JEIn19",
"purchase_data": "eyJkYXRlIjoiMTAtMDItMjAyMSIsImNoYW5nZV9kYXRlIjoiMDEtMDMtMjAgiLCJhdXRoX3RpbWUiOiIwOS0wMy0yMDI2MTA6MTUiLCJhdXRoX21ldGhvZCI6IlBBU1NXT1JEIn18",
"additional_info":{
"integration_metadata":{
"originators":[{
"moduleName":"cosmoshopPlugin",
"moduleVersion":"2.1",
"name":"COSMO_GAMES_STORE",
"session_reference":"018b163d-0b83-7ba0-b837-da575d0ff824"
}]
}
}
}
Extended list of supported parameters
This section provides an extended list of parameters to specify in purchase requests. Required parameters are listed in the section Request format.
| Parameter | Description |
|---|---|
|
additional_info |
String object containing additional information that may be relevant for payment processing. The JSON object can include various combinations of elements from the list of supported data.
"integration_metadata":{ "originators":[{ "moduleName":"cosmoshopPlugin", "moduleVersion":"2.1", "name":"COSMO_GAMES_STORE", "session_reference":"018b163d-0b83-7ba0-b837-da575d0ff824" }] }, "klarna_network_session_token":"453", "klarna_network_data": {\"content\":{\"customer_account_info\":[{\"unique_account_identifier\":\"test@gmail.com\",\"account_registration_date\":\"2017-02-13T10:49:20Z\",\"account_last_modified\":\"2019-03-13T11:45:27Z\"}]},\"content_type\":\"application/vnd.klarna.internal.emd-v2+json\"}" |
|
customer_account_info |
Information about the customer's account and contact details obtained by the web service. Consists of a string obtained by encoding a JSON object using the Base64 encoding scheme. The JSON object can include the
|
|
|
Information about the delivery of a product or a service rendered to the customer (see this article). Consists of a string obtained by encoding a JSON object using the Base64 encoding scheme. The JSON object can include various combinations of elements from the list of supported data.
"customer_shipping": [ { "first_name": "John", "last_name": "Smith", "email": "john@example.com", "phone": "+31612345678", "address": "Herengracht 101", "address2": "Herengracht 101, apt 1", "postal": "1015BG", "city": "Amsterdam", "region_code": "NH", "country": "NL", "type": "TO_DOOR", "type_attributes": [ "TRACKED", "SIGNATURE_REQUIRED" ], "carrier": "PostNL", "shipping_reference": "SHIP-COMPUTER-1" }, { "first_name": "Jane", "last_name": "Smith", "email": "jane@example.com", "phone": "+31698765432", "address": "Keizersgracht 250", "address2": "Keizersgracht 250, office reception", "postal": "1016EV", "city": "Amsterdam", "region_code": "NH", "country": "NL", "type": "TO_DOOR", "type_attributes": [ "TRACKED", "EXPRESS" ], "carrier": "DHL", "shipping_reference": "SHIP-COMPUTER-2" } ]
|
|
|
The code of the country where the document serving as a proof of the customer's identity was issued. Specified in the ISO 3166-1 alpha-2 format. Example: |
|
|
Information about line items in an order. Consists of a string obtained by encoding a JSON object using the Base64 encoding scheme. The JSON object includes the The General information about each line item (applicable to any item and sufficient for items with the
Detailed information about transportation services (for items of the
Detailed accommodation information (for items of the
Detailed information about the voucher or gift certificate (for items of the
Detailed information about the insurance service (for items of the
Detailed information about the event (for items of the
Detailed information about a product or service provided as part of an on-demand subscription plan (for items of the
Detailed information about a product or service provided as part of a subscription plan with regular debiting (for items of the
Detailed information about a good or service on the marketplace (for items of the
|
Callback format
The Klarna method uses the standard format for callbacks to deliver purchase results. For more information, see Handling callbacks.
The following is the example of a callback with information about a 10.00 EUR purchase made in the 442 project.
{
"project_id": 442,
"payment": {
"id": "EP696e-3aea",
"type": "purchase",
"status": "success",
"date": "2022-10-07T19:28:58+0000",
"method": "Klarna",
"sum": {
"amount": 1000,
"currency": "EUR"
},
"description": ""
},
"customer": {
"id": "12345"
},
"operation": {
"id": 33,
"type": "sale",
"status": "success",
"date": "2022-10-07T19:28:58+0000",
"created_date": "2022-10-07T19:28:14+0000",
"request_id": "a8ea69fdc5a83a2622-00000001",
"sum_initial": {
"amount": 1000,
"currency": "EUR"
},
"sum_converted": {
"amount": 1000,
"currency": "EUR"
},
"code": "0",
"message": "Success",
"provider": {
"id": 18052,
"payment_id": "1665170919576",
"auth_code": ""
}
},
"signature": "h14kSk782IZEgezTRpbZVe/54KGgd7mA=="
}
The following is the example of a callback with information about a declined purchase.
{
"project_id": 442,
"payment": {
"id": "EP1d27-e7ee",
"type": "purchase",
"status": "decline",
"date": "2022-10-10T09:28:33+0000",
"method": "Klarna",
"sum": {
"amount": 1500000,
"currency": "EUR"
},
"description": ""
},
"customer": {
"id": "12345"
},
"operation": {
"id": 38,
"type": "sale",
"status": "decline",
"date": "2022-10-10T09:28:33+0000",
"created_date": "2022-10-10T09:28:19+0000",
"request_id": "f56812a9270c19c04-00000001",
"sum_initial": {
"amount": 1500000,
"currency": "EUR"
},
"sum_converted": {
"amount": 1500000,
"currency": "EUR"
},
"code": "20000",
"message": "General decline",
"provider": {
"id": 18052,
"payment_id": "",
"auth_code": ""
}
},
"signature": "ZS90VEL4x5avOhc4MG85STSog=="
}
Useful links
The following articles can be useful when implementing purchases via Payment Page:
- Interaction concepts—how to organise interaction with the payment platform by using Payment Page
- Signature generation and verification—about the procedure of creating and verifying signatures in requests and callbacks.
- Payment processing—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Payment Page.
- Handling operation processing information—about error and response codes that are used in the payment platform to record information about performing of operations.
Using payment inks
General information
This method allows to process purchases via payment links created by using Gate. General information about using payment links is presented in the Payment link purchases article. Specifics of the format of requests relevant to the Klarna are presented below.
Request format
When creating requests, you need to consider the following:
- The request is sent by using POST (HTTP) method to /v2/payment/invoice/create.
- The following objects and parameters must be specified in the request:
- Object
general—general request identification information:project_id—the project identifier obtained from Ecommpay when onboardingpayment_id—payment identifier that must be unique within the projectsignature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
- Object
customer—customer information:id—customer identifier in merchant's web serviceip_address—customer IP address relevant for the initiated paymentidentify—information about the document which establishes identity:doc_number—identifier of the document serving as a proof of identity for the customer, the format depends on the customer's country of registration:- Sweden—Personal Identity Number of the form
YYYYMMDD-SSSS - Norway—National Identity Number of the form
DDMMYYIIIKK - Italy—Fiscal Code of the form
LLLLLLYYMMDDSSSC - Finland—Personal Identity Code of the form
DDMMYYCZZZQ - Spain—National Identity Document of the form
SSSSSSSSA - Denmark—Personal Identification Number of the form
DDMMYY-SSSS - USA—Social Security Number, consists of 9 digits
- Sweden—Personal Identity Number of the form
doc_issue_country—code of the country where the document serving as a proof of the customer's identity was issued. Specified in the ISO 3166-1 alpha-2 format- Object
account—information about the customer's account and contact details obtained by the web service:date—account creation date in theDD-MM-YYYYformatloyalty_level—indicator of the customer's level in the merchant's web service loyalty program, converted to one of the following values (the parameter can be omitted if thepurchase_historyobject is included in theaccountobject):01—high02—medium03—low
- Object
payment—payment information:amount—payment amount in minor currency unitscurrency—payment currency in the ISO-4217 alpha-3 formatbest_before—expiry date and time of the payment link in the following format:YYYY-MM-DDThh:mm:ss±hh:mm. Keep in mind that the validity period of the payment link cannot exceed 30 days.
- Object
- To send the payment link via the Ecommpay payment platform, specify the following parameters:
send_email—the indicator that communicates the need to send the link automatically (must be set totrue).email(in thecustomerobject)—the email of the customer to be used.language(in thecustomerobject)—the code of the language to be used in the email. The parameter is required if the customer language is not English (used by default) and the email template in this language has been previously configured in the payment platform.
- To send the payment link via your web service (and, thus, removing the option to send the email via the Ecommpay platform), pass the
send_emailparameter set tofalse. - The specific objects and parameters relevant to the Klarna method must be specified in the
klarnaobject included in thepayment_method_optionsobject. These objects and parameters correspond to the ones used when for making purchase requests via Gate by using the Klarna method.Figure 27. Klarna specific objects and parameters customer—customer information:- Object
account—information about the customer's account and contact details obtained by the web service:purchase_history—array of objects containing information about the customer's previous purchases (the parameter can be omitted if thepurchase_historyobject is included in theaccountobject):number_of_purchases—number of purchases made in the last 12 monthsnumber_of_paid_purchases—number of paid purchases in the last 12 monthstotal_amount—total amount of purchases made in the last 12 months, in the smallest units of currency specified in thecurrencyparameter the same objectcurrency—currency code for the specified amount in the ISO-4217 alpha-3 formatpayment_method—indicator of the type of payment instrument used, can have one of the following values:01—payment card of the payment system via which the payment is initiated,02—account with support of direct debiting of funds,03—mobile wallet,04—payment card of another payment system,999—other instrumentfirst_purchase_at—date and time of the customer's first purchase in the web service in theDD-MM-YYYYhh:mmformatlast_purchase_at—date and time of the customer's first purchase in the web service in theDD-MM-YYYYhh:mmformat
- Object
- Object
purchase_data—information about line items in an order, array and can include various combinations of elements from the list of supported data:positions—array, that contains information about line items, relevant to the purchase, must contain at least one object that includes the following parameters (for each item of goods or services):type—indicator that specifies the type of a line item, that can have one of the following values, defining the composition of the required parameters to be specified in thepositionsobject:discount—discount or promo code (for any goods or services),flight—air travel,car—car rental,bus—bus ride,ferry—ferry crossing,train—train ride,hotel—hotel accommodation,voucher—voucher or gift certificate,insurance—insurance,event—attending an event (for example a concert or exhibition),subscription—product or service provided as part of a subscription plan with regular debiting (for example, access to watching movies in an online cinema for a month),ondemand—product or service provided as part of an on-demand subscription plan (for example, watching a movie in an online cinema),marketplace—product or service provided via a marketplace,product—a product of a different category,service—a service of a different category,other—another type of service provided to the customername—name of the itemquantity—number of goods or services per itemamount_total—total cost of goods or services per item, in smallest currency units or as a hyphen (-) for items with thediscounttypeThe
product,service,discountandothertypes require only the parameterstype,name,quantityandamount_total.
- Whether the following parameters are required to be specified in the
positionsarray depends on the position type.The
flighttype requires the following:departure—object that contains departure information:airport—three-letter code assigned to the departure airport by the International Air Transport Association (IATA)date—departure date in theDD-MM-YYYYformatcountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:airport—three-letter code assigned to the arrival airport by the International Air Transport Association (IATA)country—country code in the arrival address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
The
cartype requires the following:departure—object that contains departure information:city—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:city—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
The
bus,train,ferrytypes require the following:departure—object that contains departure information:date—departure date in theDD-MM-YYYYformatcity—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:city—name of the city in the arrival addresscountry—country code in the arrival address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
The
hoteltype requires the following:hotel_name—name of the accommodation (for example, of a hotel or a hostel)start_date—service start date (for example, check-in date) in theDD-MM-YYYYformatend_date—service end date (for example, check-out date) in theDD-MM-YYYYformatcity—city name in the accommodation addresscountry—country code in the accommodation address in the ISO 3166-1 alpha-2 formatguests—array of objects containing information about guests:first_name—first name of the guestlast_name—last name of the guest
The
vouchertype requires the following:start_date—start date of the voucher or certificate in theDD-MM-YYYYformatcompany—name of the organisation issuing the voucher or certificate
The
eventtype requires the following:event_type—event type indicator that can have one of the following values:CONCERT—concert,FESTIVAL—festival,TOUR—excursion or tour,IN_PERSON_EDUCATION—in-person educational event,DIGITAL_EDUCATION—online educational event,SPORT—sporting event,CONFERENCE—conference,EXPO—exhibition.start_date—event start date in theDD-MM-YYYYformatend_date—event end date in theDD-MM-YYYYformatcountry—country code in the event venue's address in the ISO 3166-1 alpha-2 format
The
subscriptiontype requires the following:billing_plans, array of objects—array of objects containing subscription informationinterval, string—indicator that specifies the basic debiting period, can have one of the following values:DAY—dayWEEK—weekMONTH—monthYEAR—year
start_date, string,^\\d{2}-\\d{2}-\\d{4}$—debiting start date in theDD-MM-YYYYformat, starting from the day after the payment processing datefrequency, number—multiplier to increase the basic debiting period
The
ondemandtype requires the following:interval, string—indicator that specifies debiting frequency, can have one of the following values:DAY—dayWEEK—weekMONTH—monthYEAR—year
frequency, number—multiplier to increase debiting frequency
The
marketplacetype requires the following:seller—object containing information about the seller on the marketplace:name—name or title of the seller on the marketplacecity—name of the city where the seller is locatedcountry—country code of the seller's location in the ISO 3166-1 alpha-2 formatregistation—date of seller registration on the marketplace in theDD-MM-YYYYformat
product_category—product or service category indicator, can have one of the following values:ACCESSORIES—accessoriesAPPLIANCES—home appliancesAPPS_AND_GAMES—applications and gamesARTS_CRAFTS_AND_SEWING—arts and craftsAUTOMOTIVE—car productsBEAUTY—personal care productsBABY—children's productsBABY_CLOTHING—children's clothingBAGS_AND_PURSES—bags and pursesBOOKS—books and other printed publicationsCDS_AND_VINYL—compact discs, vinyl records, and other physical media audio recordingsCELL_PHONES_AND_ACCESSORIES—mobile phones and accessoriesCOLLECTIBLES_AND_FINE_ARTS—art and collectiblesDIGITAL_MUSIC—musical recordings in digital formatELECTRONICS—electronic devicesGROCERY_AND_GOURMET_FOOD—grocery and gourmet foodsHANDMADE—handmade productsHEALTH_AND_PERSONAL_CARE—health and personal care productsHOME_AND_KITCHEN—home and kitchen productsINDUSTRIAL_AND_SCIENTIFIC—industrial and scientific equipmentLUGGAGE_AND_TRAVEL_GEAR—luggage, travel accessories, and other travel productsMAGAZINE_SUBSCRIPTIONS—subscriptions to print or digital periodicalsMEN_CLOTHING—men's clothingMUSICAL_INSTRUMENTS—musical instrumentsOFFICE_PRODUCTS—office suppliesPATIO_LAWN_AND_GARDEN—patio and garden suppliesPET_SUPPLIES—pet suppliesSHOES—shoesSOFTWARE—softwareSPORTS_AND_OUTDOORS—sports and outdoor suppliesTOOLS_AND_HOME_IMPROVEMENT—construction tools and home improvement suppliesTOYS_AND_GAMES—toys and gamesVIDEO_GAMES—video gamesWOMEN_CLOTHING—women's clothing
additional—object containing additional information that may be relevant for payment processing:integration_metadata, object—object containing information about how the payment was technically initiated:originators, array of objects—array of objects containing information about the components used to initiate the payment (on the merchant's web service; up to six objects):name, string—name of the service via which the payment was initiated, in the form of uppercase letters, digits, and underscores (_) instead of spaces (for example,COSMO_GAMES_STORE)module_name, string—name of the technical module via which the payment was initiated, for example,cosmoshopPluginmodule_version, string—version number of the technical module via which the payment was initiated, for example,2.1session_reference, string—identifier of the operation or session within the web service, as a universally unique identifier version 7 (UUIDv7) in accordance with RFC 9562, for example,018b163d-0b83-7ba0-b837-da575d0ff824
- To increase acceptance rate and improve customer experience it is recommended to specify the following parameters in the
additionalobject included in thepayment_methods_optionsobject:klarna_network_data—string object that contains specific information that can be used for ensuring interoperability between Klarna and it's partners. Information specified in this parameter can complement information specified in other parameters. The value length must be between 1 and 10240 characters (inclusive). The object must be formatted as follows:"{\"content\":{\"customer_account_info\":[{\"unique_account_identifier\":\"test@example.com\",\"account_registration_date\":\"2017-02-13T10:49:20Z\",\"account_last_modified\":\"2019-03-13T11:45:27Z\"}]},\"content_type\":\"application/vnd.klarna.internal.emd-v2+json\"}"klarna_network_session_token—token received from a payment system or provider and intended for secure interaction within a session (for example, Klarna Network Session Token)
- To ensure the user interface complies with Klarna service requirements, it is recommended to specify the customer address country code in the
countryparameter of thecustomerobject. If the country code is not specified in the request or a code of a not officially supported country is specified, the English language can be used for displaying the Klarna service user interface, which may lead to a decrease in conversion rate. - Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Klarna method via a payment link must contain the project identifier, basic payment information (identifier, amount, and currency code), customer and line item information, as well as signature.
{
"general": {
"project_id": 123456,
"payment_id": "PMT123456-789",
"signature": "<signature>"
},
"payment": {
"amount": 10000,
"currency": "EUR",
"description": "Order ORD123456-789",
"best_before": "2026-03-08T09:00:00+03:00"
},
"customer": {
"id": "cust-9001001",
"first_name": "John",
"last_name": "Smith",
"phone": "31612345678",
"street": "Herengracht",
"address": "101",
"state": "NH",
"email": "john@example.com",
"city": "Amsterdam",
"country": "NL",
"zip": "1015BG",
"day_of_birth": "15-04-1985",
"ip_address": "1.0.0.4",
"identify": {
"doc_number": "19850415-1234",
"doc_issue_country": "SE"
},
"account": {
"date": "10-02-2021",
"change_date": "01-03-2026",
"loyalty_level": "01",
"auth_time": "09-03-202610:15",
"auth_method": "021"
}
},
"return_url": {
"return": "https://example.com/echo/success"
},
"payment_methods_options": {
"customer": {
"account": {
"purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25"
}
],
"device_purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25"
}
]
},
"shipping_extended": [
{
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "31612345678",
"address": "Herengracht 101",
"address2": "Herengracht 101",
"postal": "1015BG",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": [
"08",
"01"
],
"carrier": "PostNL",
"shipping_reference": "SHIP-COMPUTER-1"
},
{
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "31698765432",
"address": "Keizersgracht 250",
"address2": "Keizersgracht 250",
"postal": "1016EV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": [
"08",
"07",
"02"
],
"carrier": "DHL",
"shipping_reference": "SHIP-COMPUTER-2"
}
]
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "ExampleName",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001"
},
{
"type": "service",
"name": "Extended Warranty 2 Years",
"quantity": 1,
"amount_total": 19900,
"tax_total": 3458,
"amount": 19900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SVC-WARRANTY-2Y",
"item_reference": "ITEM-002",
"shipping_reference": "SHIP-001"
},
{
"type": "discount",
"name": "Summer Sale 10%",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003"
},
{
"type": "other",
"name": "some",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003"
},
{
"type": "flight",
"name": "Amsterdam → Stockholm",
"quantity": 2,
"amount_total": 45000,
"tax_total": 7820,
"amount": 22500,
"item_reference": "ITEM-004",
"booking_reference": "KL-20260601-AMS-ARN",
"departure": {
"airport": "AMS",
"date": "01-06-2026",
"city": "Amsterdam",
"country": "NL"
},
"arrival": {
"airport": "ARN",
"city": "Stockholm",
"country": "SE"
},
"airline": "KL",
"price": 22500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "AXA",
"insurance_type": "CANCELATION",
"amount": 2500,
"currency": "EUR"
}
],
"affiliate": "ExamplePartner BV"
},
{
"type": "car",
"name": "7 days rental",
"quantity": 1,
"amount_total": 35000,
"tax_total": 6079,
"amount": 35000,
"item_reference": "ITEM-005",
"departure": {
"address": "Schiphol Airport",
"address2": "Terminal 3",
"postal": "1118CP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"date": "15-06-2026"
},
"arrival": {
"address": "Arlanda Airport",
"address2": "Terminal 5",
"postal": "19060",
"city": "Stockholm",
"region_code": "AB",
"country": "SE"
},
"car_rental_company": "Hertz",
"price": 35000,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "Allianz",
"insurance_type": "LOSS_DAMAGE_WAIVER",
"amount": 1500,
"currency": "EUR"
}
],
"affiliate": "example.com"
},
{
"type": "bus",
"name": "Amsterdam → Brussels Express",
"quantity": 1,
"amount_total": 2500,
"tax_total": 434,
"amount": 2500,
"item_reference": "ITEM-006",
"departure": {
"date": "15-06-2026",
"location": "Amsterdam",
"address": "Orlyplein",
"address2": "1",
"postal": "1043DP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL"
},
"arrival": {
"address": "Rue du Progrès",
"address2": "80",
"postal": "1210",
"city": "Brussels",
"region_code": "BRU",
"country": "BE"
},
"bus_company": "FlixBus",
"price": 2500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "AXA",
"insurance_type": "CANCELATION",
"amount": 500,
"currency": "EUR"
}
],
"affiliate": "example.eu"
},
{
"type": "train",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL"
},
"arrival": {
"address": "Royal Quays",
"address2": "Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB"
},
"train_company": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
},
{
"first_name": "Jane",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "Allianz",
"insurance_type": "CANCELATION",
"amount": 1000,
"currency": "EUR"
}
],
"affiliate": "example.eu"
},
{
"type": "ferry",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden Ferry",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL"
},
"arrival": {
"address": "Royal Quays, Coble Dene",
"address2": "Royal Quays, Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB"
},
"ferry_line": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "Allianz",
"insurance_type": "CANCELATION",
"amount": 1000,
"currency": "EUR"
}
],
"affiliate": "example.eu"
},
{
"type": "hotel",
"name": "Hotel 1",
"quantity": 1,
"amount_total": 75000,
"tax_total": 13025,
"amount": 75000,
"item_reference": "ITEM-008",
"hotel_name": "Hotel",
"start_date": "01-06-2026",
"end_date": "04-06-2026",
"address": "Nes",
"address2": "49",
"postal": "1012KD",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"lodging_type": "ROOM",
"rooms": 1,
"price": 25000,
"currency": "EUR",
"guests": [
{
"first_name": "John",
"last_name": "Smith"
},
{
"first_name": "Jane",
"last_name": "Smith"
}
],
"host": {
"host_reference": "HOST-0042",
"type": "HOTEL",
"country": "NL",
"registration_date": "12-01-2015",
"reservations": 312
},
"insurances": [
{
"company": "Europ",
"insurance_type": "CANCELATION",
"amount": 3000,
"currency": "EUR"
}
],
"affiliate": "example.com"
},
{
"type": "voucher",
"name": "Gift Card",
"quantity": 1,
"amount_total": 5000,
"tax_total": 869,
"amount": 5000,
"item_reference": "ITEM-009",
"start_date": "01-06-2026",
"end_date": "01-06-2027",
"voucher_type": "GIFT_CARD",
"company": "example.com",
"affiliate": "example.nl"
},
{
"type": "insurance",
"name": "Travel",
"quantity": 1,
"amount_total": 4500,
"tax_total": 782,
"item_reference": "ITEM-010",
"company": "AXA",
"insurance_type": "MEDICAL",
"amount": 4500,
"currency": "EUR"
},
{
"type": "event",
"name": "Dance Event",
"quantity": 2,
"amount_total": 15000,
"tax_total": 2607,
"amount": 7500,
"item_reference": "ITEM-011",
"company": "ID&T",
"event_type": "FESTIVAL",
"start_date": "14-10-2026",
"end_date": "18-10-2026",
"venue_name": "Example Dome",
"access_controlled": true,
"address": "De Passage 100",
"address2": "De Passage 100",
"postal": "1101AX",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"insurances": [
{
"company": "AXA",
"insurance_type": "CANCELATION",
"amount": 1500,
"currency": "EUR"
}
],
"affiliate": "example.nl"
},
{
"type": "marketplace",
"name": "Jacket",
"quantity": 1,
"amount_total": 12500,
"tax_total": 2172,
"amount": 12500,
"product_url": "https://marketplace.example.com",
"product_image": "https://marketplace.example.com",
"product_reference": "SKU-VLJ-001",
"item_reference": "ITEM-014",
"shipping_reference": "SHIP-002",
"seller": {
"reference": "SELLER-7890",
"name": "BV",
"address": "263",
"address2": "123",
"postal": "1016GV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"registration": "15-03-2019",
"registration_updated": "10-01-2025",
"last_login": "16-04-2026",
"rating": "HIGH"
},
"product_category": "WOMEN_CLOTHING",
"line_item_references": [
"ITEM-014"
],
"shipping_references": [
"SHIP-002"
],
"number_of_transactions": 145,
"volume_of_transactions": 1875000
}
]
},
"additional": {
"integration_metadata": {
"originators": [
{
"moduleName": "cosmoshopPlugin",
"moduleVersion": "2.1",
"name": "COSMO_GAMES_STORE",
"session_reference": "018b163d-0b83-7ba0-b837-da575d0ff824"
}
]
},
"klarna_network_session_token": "krn:network:eu1:test:session-token:eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0ZThhZTBjLWQyNjYtNDY0Zi05OWNjLWYyNjcyYmVjOWJiNCJ9.eyJzaG9wcGluZ19zZXNzaW9uX2lkIjoia3JuOnNob3BwaW5nOmV1MTp0ZXN0OnNlc3Npb246OWRiNDM5M2YtMmJjMC00MDk3LWFlMjgtOWFiYzA5NTk5MjcyIiwicGF5bWVudF9yZXF1ZXN0cyI6W10sInByZV9xdWFsaWZpY2F0aW9uIjp7fSwiaXNzIjoic2Vzc2lvbi1hY3F1aXJpbmctc2VydmljZSIsInZlciI6IjEuMC4wIiwiaWF0IjoxNzg2MDExMTYyLCJleHAiOjE3ODYwMTQ3NjJ9.V7rciwYKNPUb-4B_-sJ7dWVRkSTNcCmdwdf1_WQn5ZfjVEKh5Ua_gDUXAQRaHilB8JLM0YODQXcAdy81ONLTfQ",
"klarna_network_data": "{\"content_type\":\"vnd.klarna.network-data.v2+json\",\"content\":{\"operation\":\"payment_request\",\"request\":{\"supplementary_purchase_data\":{\"purchase_reference\":\"KLARNA_SALE_ORDER_ID_2026_06_15_12_17_06_054808_5RxIU\",\"customer\":{\"identity_identification\":{\"number\":\"198504******1234\",\"country\":\"SE\"},\"customer_account\":{\"loyalty_level\":\"HIGH\",\"created_at\":\"2021-02-10T09:17:12Z\"},\"customer_device\":{\"ip_address\":\"1.0.0.4\"}},\"line_items\":[{\"name\":\"Lenovo ThinkPad X1 Carbon Gen 12\",\"quantity\":1,\"total_amount\":189900}]}}}}"
}
}
}
{
"general": {
"project_id": 123456,
"payment_id": "PMT123456-789",
"signature": "<signature>"
},
"payment": {
"amount": 10000,
"currency": "EUR",
"description": "Order ORD123456-789",
"best_before": "2026-03-08T09:00:00+03:00"
},
"customer": {
"id": "cust-9001001",
"first_name": "John",
"last_name": "Smith",
"phone": "31612345678",
"street": "Herengracht",
"address": "101",
"state": "NH",
"email": "john@example.com",
"city": "Amsterdam",
"country": "NL",
"zip": "1015BG",
"day_of_birth": "15-04-1985",
"ip_address": "1.0.0.4",
"identify": {
"doc_number": "19850415-1234",
"doc_issue_country": "SE"
},
"account": {
"date": "10-02-2021",
"change_date": "01-03-2026",
"loyalty_level": "01",
"auth_time": "09-03-202610:15",
"auth_method": "021"
}
},
"return_url": {
"return": "https://example.com/echo/success"
},
"payment_methods_options": {
"customer": {
"account": {
"purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25"
}
],
"device_purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25"
}
]
},
"shipping_extended": [
{
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "31612345678",
"address": "Herengracht 101",
"address2": "Herengracht 101",
"postal": "1015BG",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": [
"08",
"01"
],
"carrier": "PostNL",
"shipping_reference": "SHIP-COMPUTER-1"
},
{
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "31698765432",
"address": "Keizersgracht 250",
"address2": "Keizersgracht 250",
"postal": "1016EV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": [
"08",
"07",
"02"
],
"carrier": "DHL",
"shipping_reference": "SHIP-COMPUTER-2"
}
]
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "ExampleName",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001"
},
{
"type": "service",
"name": "Extended Warranty 2 Years",
"quantity": 1,
"amount_total": 19900,
"tax_total": 3458,
"amount": 19900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SVC-WARRANTY-2Y",
"item_reference": "ITEM-002",
"shipping_reference": "SHIP-001"
},
{
"type": "discount",
"name": "Summer Sale 10%",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003"
},
{
"type": "other",
"name": "some",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003"
},
{
"type": "flight",
"name": "Amsterdam → Stockholm",
"quantity": 2,
"amount_total": 45000,
"tax_total": 7820,
"amount": 22500,
"item_reference": "ITEM-004",
"booking_reference": "KL-20260601-AMS-ARN",
"departure": {
"airport": "AMS",
"date": "01-06-2026",
"city": "Amsterdam",
"country": "NL"
},
"arrival": {
"airport": "ARN",
"city": "Stockholm",
"country": "SE"
},
"airline": "KL",
"price": 22500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "AXA",
"insurance_type": "CANCELATION",
"amount": 2500,
"currency": "EUR"
}
],
"affiliate": "ExamplePartner BV"
},
{
"type": "car",
"name": "7 days rental",
"quantity": 1,
"amount_total": 35000,
"tax_total": 6079,
"amount": 35000,
"item_reference": "ITEM-005",
"departure": {
"address": "Schiphol Airport",
"address2": "Terminal 3",
"postal": "1118CP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"date": "15-06-2026"
},
"arrival": {
"address": "Arlanda Airport",
"address2": "Terminal 5",
"postal": "19060",
"city": "Stockholm",
"region_code": "AB",
"country": "SE"
},
"car_rental_company": "Hertz",
"price": 35000,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "Allianz",
"insurance_type": "LOSS_DAMAGE_WAIVER",
"amount": 1500,
"currency": "EUR"
}
],
"affiliate": "example.com"
},
{
"type": "bus",
"name": "Amsterdam → Brussels Express",
"quantity": 1,
"amount_total": 2500,
"tax_total": 434,
"amount": 2500,
"item_reference": "ITEM-006",
"departure": {
"date": "15-06-2026",
"location": "Amsterdam",
"address": "Orlyplein",
"address2": "1",
"postal": "1043DP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL"
},
"arrival": {
"address": "Rue du Progrès",
"address2": "80",
"postal": "1210",
"city": "Brussels",
"region_code": "BRU",
"country": "BE"
},
"bus_company": "FlixBus",
"price": 2500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "AXA",
"insurance_type": "CANCELATION",
"amount": 500,
"currency": "EUR"
}
],
"affiliate": "example.eu"
},
{
"type": "train",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL"
},
"arrival": {
"address": "Royal Quays",
"address2": "Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB"
},
"train_company": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
},
{
"first_name": "Jane",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "Allianz",
"insurance_type": "CANCELATION",
"amount": 1000,
"currency": "EUR"
}
],
"affiliate": "example.eu"
},
{
"type": "ferry",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden Ferry",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL"
},
"arrival": {
"address": "Royal Quays, Coble Dene",
"address2": "Royal Quays, Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB"
},
"ferry_line": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{
"first_name": "John",
"last_name": "Smith"
}
],
"insurances": [
{
"company": "Allianz",
"insurance_type": "CANCELATION",
"amount": 1000,
"currency": "EUR"
}
],
"affiliate": "example.eu"
},
{
"type": "hotel",
"name": "Hotel 1",
"quantity": 1,
"amount_total": 75000,
"tax_total": 13025,
"amount": 75000,
"item_reference": "ITEM-008",
"hotel_name": "Hotel",
"start_date": "01-06-2026",
"end_date": "04-06-2026",
"address": "Nes",
"address2": "49",
"postal": "1012KD",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"lodging_type": "ROOM",
"rooms": 1,
"price": 25000,
"currency": "EUR",
"guests": [
{
"first_name": "John",
"last_name": "Smith"
},
{
"first_name": "Jane",
"last_name": "Smith"
}
],
"host": {
"host_reference": "HOST-0042",
"type": "HOTEL",
"country": "NL",
"registration_date": "12-01-2015",
"reservations": 312
},
"insurances": [
{
"company": "Europ",
"insurance_type": "CANCELATION",
"amount": 3000,
"currency": "EUR"
}
],
"affiliate": "example.com"
},
{
"type": "voucher",
"name": "Gift Card",
"quantity": 1,
"amount_total": 5000,
"tax_total": 869,
"amount": 5000,
"item_reference": "ITEM-009",
"start_date": "01-06-2026",
"end_date": "01-06-2027",
"voucher_type": "GIFT_CARD",
"company": "example.com",
"affiliate": "example.nl"
},
{
"type": "insurance",
"name": "Travel",
"quantity": 1,
"amount_total": 4500,
"tax_total": 782,
"item_reference": "ITEM-010",
"company": "AXA",
"insurance_type": "MEDICAL",
"amount": 4500,
"currency": "EUR"
},
{
"type": "event",
"name": "Dance Event",
"quantity": 2,
"amount_total": 15000,
"tax_total": 2607,
"amount": 7500,
"item_reference": "ITEM-011",
"company": "ID&T",
"event_type": "FESTIVAL",
"start_date": "14-10-2026",
"end_date": "18-10-2026",
"venue_name": "Example Dome",
"access_controlled": true,
"address": "De Passage 100",
"address2": "De Passage 100",
"postal": "1101AX",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"insurances": [
{
"company": "AXA",
"insurance_type": "CANCELATION",
"amount": 1500,
"currency": "EUR"
}
],
"affiliate": "example.nl"
},
{
"type": "marketplace",
"name": "Jacket",
"quantity": 1,
"amount_total": 12500,
"tax_total": 2172,
"amount": 12500,
"product_url": "https://marketplace.example.com",
"product_image": "https://marketplace.example.com",
"product_reference": "SKU-VLJ-001",
"item_reference": "ITEM-014",
"shipping_reference": "SHIP-002",
"seller": {
"reference": "SELLER-7890",
"name": "BV",
"address": "263",
"address2": "123",
"postal": "1016GV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"registration": "15-03-2019",
"registration_updated": "10-01-2025",
"last_login": "16-04-2026",
"rating": "HIGH"
},
"product_category": "WOMEN_CLOTHING",
"line_item_references": [
"ITEM-014"
],
"shipping_references": [
"SHIP-002"
],
"number_of_transactions": 145,
"volume_of_transactions": 1875000
}
]
},
"additional": {
"integration_metadata": {
"originators": [
{
"moduleName": "cosmoshopPlugin",
"moduleVersion": "2.1",
"name": "COSMO_GAMES_STORE",
"session_reference": "018b163d-0b83-7ba0-b837-da575d0ff824"
}
]
},
"klarna_network_session_token": "krn:network:eu1:test:session-token:eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0ZThhZTBjLWQyNjYtNDY0Zi05OWNjLWYyNjcyYmVjOWJiNCJ9.eyJzaG9wcGluZ19zZXNzaW9uX2lkIjoia3JuOnNob3BwaW5nOmV1MTp0ZXN0OnNlc3Npb246OWRiNDM5M2YtMmJjMC00MDk3LWFlMjgtOWFiYzA5NTk5MjcyIiwicGF5bWVudF9yZXF1ZXN0cyI6W10sInByZV9xdWFsaWZpY2F0aW9uIjp7fSwiaXNzIjoic2Vzc2lvbi1hY3F1aXJpbmctc2VydmljZSIsInZlciI6IjEuMC4wIiwiaWF0IjoxNzg2MDExMTYyLCJleHAiOjE3ODYwMTQ3NjJ9.V7rciwYKNPUb-4B_-sJ7dWVRkSTNcCmdwdf1_WQn5ZfjVEKh5Ua_gDUXAQRaHilB8JLM0YODQXcAdy81ONLTfQ",
"klarna_network_data": "{\"content_type\":\"vnd.klarna.network-data.v2+json\",\"content\":{\"operation\":\"payment_request\",\"request\":{\"supplementary_purchase_data\":{\"purchase_reference\":\"KLARNA_SALE_ORDER_ID_2026_06_15_12_17_06_054808_5RxIU\",\"customer\":{\"identity_identification\":{\"number\":\"198504******1234\",\"country\":\"SE\"},\"customer_account\":{\"loyalty_level\":\"HIGH\",\"created_at\":\"2021-02-10T09:17:12Z\"},\"customer_device\":{\"ip_address\":\"1.0.0.4\"}},\"line_items\":[{\"name\":\"Lenovo ThinkPad X1 Carbon Gen 12\",\"quantity\":1,\"total_amount\":189900}]}}}}"
}
}
}
Purchases by using Gate
General information
To process a purchase through Gate by using the Klarna method, the merchant's web service is required to do the following:
- Send a request with all the required parameters and signature to the Ecommpay URL.
- Receive an intermediate callback from the payment platform and redirect the customer to the Klarna service.
- Receive the final callback from the payment platform.
Klarna method allows customers to use the following payment options Pay in full, Pay in 3, Pay in 4, Pay in 30 days, Financing / Pay over time. The full sequence and special aspects of purchase processing are provided below.
- A customer initiates a purchase by using the Klarna method in the web service.
- The web service sends the request for processing the purchase by using Gate to the specified Ecommpay URL.
- The payment platform receives the request.
- The payment platform validates the required parameters and signature in the request.
- The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
- The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Klarna service.
- The request is processed on the Klarna service side.
- The Klarna service sends the redirection data to the payment platform.
- The payment platform sends the callback with the redirection data to the web service.
- The customer is redirected to the Klarna service.
- The customer completes all required payment steps.
- The purchase is processed on the side of the Klarna service.
- The result is displayed to the customer.
- The customer is redirected to the web service.
- The Klarna service sends the payment result notification to the payment platform.
- The payment platform sends the payment result callback to the web service.
- The customer receives the payment result information from the web service.
Information about the formats of requests and callbacks used for processing payments by using the Klarna method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
Format of requests for purchase processing
There are several things you need to consider when sending purchase requests for by using the Klarna method:
- To initiate each purchase, send a separate POST request to one of the following endpoints:
- /v2/payment/klarna/sale for one-step purchases
- /v2/payment/klarna/auth for two-step purchases
- Each request must include the following objects and parameters:
- Object
general—general purchase information:project_id—project identifier obtained from Ecommpay during integrationpayment_id—payment identifier unique within the projectsignature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
- Object
payment—payment information:amount—payment amount in the smallest currency unitcurrency—payment currency code in the ISO-4217 alpha-3 format
- Object
customer—customer information:id—customer identifier unique within the projectip_address—customer IP address relevant for the initiated paymentidentify—information about the document which establishes identity:doc_number—identifier of the document serving as a proof of identity for the customer, the format depends on the customer's country of registration:- Sweden—Personal Identity Number of the form
YYYYMMDD-SSSS - Norway—National Identity Number of the form
DDMMYYIIIKK - Italy—Fiscal Code of the form
LLLLLLYYMMDDSSSC - Finland—Personal Identity Code of the form
DDMMYYCZZZQ - Spain—National Identity Document of the form
SSSSSSSSA - Denmark—Personal Identification Number of the form
DDMMYY-SSSS - USA—Social Security Number, consists of 9 digits
- Sweden—Personal Identity Number of the form
doc_issue_country—code of the country where the document serving as a proof of the customer's identity was issued. Specified in the ISO 3166-1 alpha-2 format- Object
account—information about the customer's account and contact details obtained by the web service:date—account creation date in theDD-MM-YYYYformatloyalty_level—indicator of the customer's level in the merchant's web service loyalty program, converted to one of the following values (the parameter can be omitted if thepurchase_historyobject is included in theaccountobject):01—high02—medium03—low
purchase_history—array of objects containing information about the customer's previous purchases (the parameter can be omitted if thepurchase_historyobject is included in theaccountobject):number_of_purchases—number of purchases made in the last 12 monthsnumber_of_paid_purchases—number of paid purchases in the last 12 monthstotal_amount—total amount of purchases made in the last 12 months, in the smallest units of currency specified in thecurrencyparameter the same objectcurrency—currency code for the specified amount in the ISO-4217 alpha-3 formatpayment_method—indicator of the type of payment instrument used, can have one of the following values:01—payment card of the payment system via which the payment is initiated,02—account with support of direct debiting of funds,03—mobile wallet,04—payment card of another payment system,999—other instrumentfirst_purchase_at—date and time of the customer's first purchase in the web service in theDD-MM-YYYYhh:mmformatlast_purchase_at—date and time of the customer's first purchase in the web service in theDD-MM-YYYYhh:mmformat
- Object
purchase_data—information about line items in an order, array and can include various combinations of elements from the list of supported data:positions—array, that contains information about line items, relevant to the purchase, must contain at least one object that includes the following parameters (for each item of goods or services):type—indicator that specifies the type of a line item, that can have one of the following values, defining the composition of the required parameters to be specified in thepositionsobject:discount—discount or promo code (for any goods or services),flight—air travel,car—car rental,bus—bus ride,ferry—ferry crossing,train—train ride,hotel—hotel accommodation,voucher—voucher or gift certificate,insurance—insurance,event—attending an event (for example a concert or exhibition),subscription—product or service provided as part of a subscription plan with regular debiting (for example, access to watching movies in an online cinema for a month),ondemand—product or service provided as part of an on-demand subscription plan (for example, watching a movie in an online cinema),marketplace—product or service provided via a marketplace,product—a product of a different category,service—a service of a different category,other—another type of service provided to the customername—name of the itemquantity—number of goods or services per itemamount_total—total cost of goods or services per item, in smallest currency units or as a hyphen (-) for items with thediscounttypeThe
product,service,discountandothertypes require only the parameterstype,name,quantityandamount_total.
- Whether the following parameters are required to be specified in the
positionsarray depends on the position type.Figure 30. flight departure—object that contains departure information:airport—three-letter code assigned to the departure airport by the International Air Transport Association (IATA)date—departure date in theDD-MM-YYYYformatcountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:airport—three-letter code assigned to the arrival airport by the International Air Transport Association (IATA)country—country code in the arrival address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
Figure 31. car departure—object that contains departure information:city—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:city—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
Figure 32. bus, train, ferry departure—object that contains departure information:date—departure date in theDD-MM-YYYYformatcity—name of the city in the departure addresscountry—country code in the departure address in the ISO 3166-1 alpha-2 format
arrival—object that contains arrival information:city—name of the city in the arrival addresscountry—country code in the arrival address in the ISO 3166-1 alpha-2 format
passengers—array of objects containing passenger information:first_name—first name of the passengerlast_name—last name of the passenger
Figure 33. hotel hotel_name—name of the accommodation (for example, of a hotel or a hostel)start_date—service start date (for example, check-in date) in theDD-MM-YYYYformatend_date—service end date (for example, check-out date) in theDD-MM-YYYYformatcity—city name in the accommodation addresscountry—country code in the accommodation address in the ISO 3166-1 alpha-2 formatguests—array of objects containing information about guests:first_name—first name of the guestlast_name—last name of the guest
Figure 34. voucher start_date—start date of the voucher or certificate in theDD-MM-YYYYformatcompany—name of the organisation issuing the voucher or certificate
Figure 35. event event_type—event type indicator that can have one of the following values:CONCERT—concert,FESTIVAL—festival,TOUR—excursion or tour,IN_PERSON_EDUCATION—in-person educational event,DIGITAL_EDUCATION—online educational event,SPORT—sporting event,CONFERENCE—conference,EXPO—exhibition.start_date—event start date in theDD-MM-YYYYformatend_date—event end date in theDD-MM-YYYYformatcountry—country code in the event venue's address in the ISO 3166-1 alpha-2 format
Figure 36. subscription billing_plans, array of objects—array of objects containing subscription informationinterval, string—indicator that specifies the basic debiting period, can have one of the following values:DAY—dayWEEK—weekMONTH—monthYEAR—year
start_date, string,^\\d{2}-\\d{2}-\\d{4}$—debiting start date in theDD-MM-YYYYformat, starting from the day after the payment processing datefrequency, number—multiplier to increase the basic debiting period
Figure 37. ondemand interval, string—indicator that specifies debiting frequency, can have one of the following values:DAY—dayWEEK—weekMONTH—monthYEAR—year
frequency, number—multiplier to increase debiting frequency
Figure 38. marketplace seller—object containing information about the seller on the marketplace:name—name or title of the seller on the marketplacecity—name of the city where the seller is locatedcountry—country code of the seller's location in the ISO 3166-1 alpha-2 formatregistation—date of seller registration on the marketplace in theDD-MM-YYYYformat
product_category—product or service category indicator, can have one of the following values:ACCESSORIES—accessoriesAPPLIANCES—home appliancesAPPS_AND_GAMES—applications and gamesARTS_CRAFTS_AND_SEWING—arts and craftsAUTOMOTIVE—car productsBEAUTY—personal care productsBABY—children's productsBABY_CLOTHING—children's clothingBAGS_AND_PURSES—bags and pursesBOOKS—books and other printed publicationsCDS_AND_VINYL—compact discs, vinyl records, and other physical media audio recordingsCELL_PHONES_AND_ACCESSORIES—mobile phones and accessoriesCOLLECTIBLES_AND_FINE_ARTS—art and collectiblesDIGITAL_MUSIC—musical recordings in digital formatELECTRONICS—electronic devicesGROCERY_AND_GOURMET_FOOD—grocery and gourmet foodsHANDMADE—handmade productsHEALTH_AND_PERSONAL_CARE—health and personal care productsHOME_AND_KITCHEN—home and kitchen productsINDUSTRIAL_AND_SCIENTIFIC—industrial and scientific equipmentLUGGAGE_AND_TRAVEL_GEAR—luggage, travel accessories, and other travel productsMAGAZINE_SUBSCRIPTIONS—subscriptions to print or digital periodicalsMEN_CLOTHING—men's clothingMUSICAL_INSTRUMENTS—musical instrumentsOFFICE_PRODUCTS—office suppliesPATIO_LAWN_AND_GARDEN—patio and garden suppliesPET_SUPPLIES—pet suppliesSHOES—shoesSOFTWARE—softwareSPORTS_AND_OUTDOORS—sports and outdoor suppliesTOOLS_AND_HOME_IMPROVEMENT—construction tools and home improvement suppliesTOYS_AND_GAMES—toys and gamesVIDEO_GAMES—video gamesWOMEN_CLOTHING—women's clothing
additional—object containing additional information that may be relevant for payment processing:integration_metadata, object—object containing information about how the payment was technically initiated:originators, array of objects—array of objects containing information about the components used to initiate the payment (on the merchant's web service; up to six objects):name, string—name of the service via which the payment was initiated, in the form of uppercase letters, digits, and underscores (_) instead of spaces (for example,COSMO_GAMES_STORE)module_name, string—name of the technical module via which the payment was initiated, for example,cosmoshopPluginmodule_version, string—version number of the technical module via which the payment was initiated, for example,2.1session_reference, string—identifier of the operation or session within the web service, as a universally unique identifier version 7 (UUIDv7) in accordance with RFC 9562, for example,018b163d-0b83-7ba0-b837-da575d0ff824
- Object
- To ensure the user interface complies with Klarna service requirements, it is recommended to specify the customer address country code in the
countryparameter of thecustomerobject. If the country code is not specified in the request or a code of a not officially supported country is specified, the English language can be used for displaying the Klarna service user interface, which may lead to a decrease in conversion rate. - Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Klarna method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer and line item information, as well as signature.
{
"general": {
"project_id": 123456,
"payment_id": "PMT123456-789",
"signature": "<signature>",
},
"payment": {
"amount": 10000,
"currency": EUR,
"description": "Order ORD123456-789"
},
"customer": {
"id": "cust-9001001",
"first_name": "John",
"last_name": "Smith",
"phone": "31612345678",
"street": "Herengracht",
"address": "101",
"state": "NH",
"email": "john@example.com",
"city": "Amsterdam",
"country": "NL",
"zip": "1015BG",
"day_of_birth": "15-04-1985",
"ip_address": "1.0.0.4",
"identify": {
"doc_number": "19850415-1234",
"doc_issue_country": "SE",
},
"account": {
"date": "10-02-2021",
"change_date": "01-03-2026",
"loyalty_level": "01",
"auth_time": "09-03-202610:15",
"auth_method": "021",
"purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25",
}
],
"device_purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25",
}
],
},
"shipping_extended": [
{
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "31612345678",
"address": "Herengracht 101",
"address2": "Herengracht 101",
"postal": "1015BG",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": ["08", "01"],
"carrier": "PostNL",
"shipping_reference": "SHIP-COMPUTER-1",
},
{
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "31698765432",
"address": "Keizersgracht 250",
"address2": "Keizersgracht 250",
"postal": "1016EV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": ["08", "07", "02"],
"carrier": "DHL",
"shipping_reference": "SHIP-COMPUTER-2",
},
],
},
"return_url": {
"return": "https://example.com/echo/success",
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "ExampleName",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001",
},
{
"type": "service",
"name": "Extended Warranty 2 Years",
"quantity": 1,
"amount_total": 19900,
"tax_total": 3458,
"amount": 19900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SVC-WARRANTY-2Y",
"item_reference": "ITEM-002",
"shipping_reference": "SHIP-001",
},
{
"type": "discount",
"name": "Summer Sale 10%",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003",
},
{
"type": "other",
"name": "some",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003",
},
{
"type": "flight",
"name": "Amsterdam → Stockholm",
"quantity": 2,
"amount_total": 45000,
"tax_total": 7820,
"amount": 22500,
"item_reference": "ITEM-004",
"booking_reference": "KL-20260601-AMS-ARN",
"departure": {"airport": "AMS", "date": "01-06-2026", "city": "Amsterdam", "country": "NL"},
"arrival": {"airport": "ARN", "city": "Stockholm", "country": "SE"},
"airline": "KL",
"price": 22500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{"first_name": "John", "last_name": "Smith"}
],
"insurances": [{"company": "AXA", "insurance_type": "CANCELATION", "amount": 2500, "currency": "EUR"}],
"affiliate": "ExamplePartner BV",
},
{
"type": "car",
"name": "7 days rental",
"quantity": 1,
"amount_total": 35000,
"tax_total": 6079,
"amount": 35000,
"item_reference": "ITEM-005",
"departure": {
"address": "Schiphol Airport",
"address2": "Terminal 3",
"postal": "1118CP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"date": "15-06-2026",
},
"arrival": {
"address": "Arlanda Airport",
"address2": "Terminal 5",
"postal": "19060",
"city": "Stockholm",
"region_code": "AB",
"country": "SE",
},
"car_rental_company": "Hertz",
"price": 35000,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [{"first_name": "John", "last_name": "Smith"}],
"insurances": [{"company": "Allianz", "insurance_type": "LOSS_DAMAGE_WAIVER", "amount": 1500, "currency": "EUR"}],
"affiliate": "example.com",
},
{
"type": "bus",
"name": "Amsterdam → Brussels Express",
"quantity": 1,
"amount_total": 2500,
"tax_total": 434,
"amount": 2500,
"item_reference": "ITEM-006",
"departure": {
"date": "15-06-2026",
"location": "Amsterdam",
"address": "Orlyplein",
"address2": "1",
"postal": "1043DP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
},
"arrival": {
"address": "Rue du Progrès",
"address2": "80",
"postal": "1210",
"city": "Brussels",
"region_code": "BRU",
"country": "BE",
},
"bus_company": "FlixBus",
"price": 2500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [{"first_name": "John", "last_name": "Smith"}],
"insurances": [{"company": "AXA", "insurance_type": "CANCELATION", "amount": 500, "currency": "EUR"}],
"affiliate": "example.eu",
},
{
"type": "train",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL",
},
"arrival": {
"address": "Royal Quays",
"address2": "Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB",
},
"train_company": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{"first_name": "John", "last_name": "Smith"},
{"first_name": "Jane", "last_name": "Smith"},
],
"insurances": [
{"company": "Allianz", "insurance_type": "CANCELATION", "amount": 1000, "currency": "EUR"}
],
"affiliate": "example.eu",
},
{
"type": "ferry",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden Ferry",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL",
},
"arrival": {
"address": "Royal Quays, Coble Dene",
"address2": "Royal Quays, Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB",
},
"ferry_line": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{"first_name": "John", "last_name": "Smith"},
],
"insurances": [
{"company": "Allianz", "insurance_type": "CANCELATION", "amount": 1000, "currency": "EUR"}
],
"affiliate": "example.eu",
},
{
"type": "hotel",
"name": "Hotel 1",
"quantity": 1,
"amount_total": 75000,
"tax_total": 13025,
"amount": 75000,
"item_reference": "ITEM-008",
"hotel_name": "Hotel",
"start_date": "01-06-2026",
"end_date": "04-06-2026",
"address": "Nes",
"address2": "49",
"postal": "1012KD",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"lodging_type": "ROOM",
"rooms": 1,
"price": 25000,
"currency": "EUR",
"guests": [{"first_name": "John", "last_name": "Smith"}, {"first_name": "Jane", "last_name": "Smith"}],
"host": {
"host_reference": "HOST-0042",
"type": "HOTEL",
"country": "NL",
"registration_date": "12-01-2015",
"reservations": 312,
},
"insurances": [
{"company": "Europ", "insurance_type": "CANCELATION", "amount": 3000, "currency": "EUR"}
],
"affiliate": "example.com",
},
{
"type": "voucher",
"name": "Gift Card",
"quantity": 1,
"amount_total": 5000,
"tax_total": 869,
"amount": 5000,
"item_reference": "ITEM-009",
"start_date": "01-06-2026",
"end_date": "01-06-2027",
"voucher_type": "GIFT_CARD",
"company": "example.com",
"affiliate": "example.nl",
},
{
"type": "insurance",
"name": "Travel",
"quantity": 1,
"amount_total": 4500,
"tax_total": 782,
"item_reference": "ITEM-010",
"company": "AXA",
"insurance_type": "MEDICAL",
"amount": 4500,
"currency": "EUR",
},
{
"type": "event",
"name": "Dance Event",
"quantity": 2,
"amount_total": 15000,
"tax_total": 2607,
"amount": 7500,
"item_reference": "ITEM-011",
"company": "ID&T",
"event_type": "FESTIVAL",
"start_date": "14-10-2026",
"end_date": "18-10-2026",
"venue_name": "Example Dome",
"access_controlled": True,
"address": "De Passage 100",
"address2": "De Passage 100",
"postal": "1101AX",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"insurances": [{"company": "AXA", "insurance_type": "CANCELATION", "amount": 1500, "currency": "EUR"}],
"affiliate": "example.nl",
},
{
"type": "marketplace",
"name": "Jacket",
"quantity": 1,
"amount_total": 12500,
"tax_total": 2172,
"amount": 12500,
"product_url": "https://marketplace.example.com",
"product_image": "https://marketplace.example.com",
"product_reference": "SKU-VLJ-001",
"item_reference": "ITEM-014",
"shipping_reference": "SHIP-002",
"seller": {
"reference": "SELLER-7890",
"name": "BV",
"address": "263",
"address2": "123",
"postal": "1016GV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"registration": "15-03-2019",
"registration_updated": "10-01-2025",
"last_login": "16-04-2026",
"rating": "HIGH",
},
"product_category": "WOMEN_CLOTHING",
"line_item_references": ["ITEM-014"],
"shipping_references": ["SHIP-002"],
"number_of_transactions": 145,
"volume_of_transactions": 1875000,
},
]
},
"additional": {
"integration_metadata": {
"originators": [
"moduleName":"cosmoshopPlugin",
"moduleVersion":"2.1",
"name":"COSMO_GAMES_STORE",
"session_reference":"018b163d-0b83-7ba0-b837-da575d0ff824"
]
}
}
}
{
"general": {
"project_id": 123456,
"payment_id": "PMT123456-789",
"signature": "<signature>",
},
"payment": {
"amount": 10000,
"currency": EUR,
"description": "Order ORD123456-789"
},
"customer": {
"id": "cust-9001001",
"first_name": "John",
"last_name": "Smith",
"phone": "31612345678",
"street": "Herengracht",
"address": "101",
"state": "NH",
"email": "john@example.com",
"city": "Amsterdam",
"country": "NL",
"zip": "1015BG",
"day_of_birth": "15-04-1985",
"ip_address": "1.0.0.4",
"identify": {
"doc_number": "19850415-1234",
"doc_issue_country": "SE",
},
"account": {
"date": "10-02-2021",
"change_date": "01-03-2026",
"loyalty_level": "01",
"auth_time": "09-03-202610:15",
"auth_method": "021",
"purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25",
}
],
"device_purchase_history": [
{
"number_of_purchases": 18,
"number_of_paid_purchases": 17,
"number_of_disputed_purchases": 1,
"total_amount": 845900,
"currency": "EUR",
"payment_method": "01",
"first_purchase_at": "14-03-202309:40",
"last_purchase_at": "01-03-202620:25",
}
],
},
"shipping_extended": [
{
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "31612345678",
"address": "Herengracht 101",
"address2": "Herengracht 101",
"postal": "1015BG",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": ["08", "01"],
"carrier": "PostNL",
"shipping_reference": "SHIP-COMPUTER-1",
},
{
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "31698765432",
"address": "Keizersgracht 250",
"address2": "Keizersgracht 250",
"postal": "1016EV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"type": "011",
"type_attributes": ["08", "07", "02"],
"carrier": "DHL",
"shipping_reference": "SHIP-COMPUTER-2",
},
],
},
"return_url": {
"return": "https://example.com/echo/success",
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "ExampleName",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001",
},
{
"type": "service",
"name": "Extended Warranty 2 Years",
"quantity": 1,
"amount_total": 19900,
"tax_total": 3458,
"amount": 19900,
"product_url": "https://merchant.example.com",
"product_image": "https://merchant.example.com",
"product_reference": "SVC-WARRANTY-2Y",
"item_reference": "ITEM-002",
"shipping_reference": "SHIP-001",
},
{
"type": "discount",
"name": "Summer Sale 10%",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003",
},
{
"type": "other",
"name": "some",
"quantity": 1,
"amount_total": 20990,
"tax_total": 3643,
"amount": 20990,
"item_reference": "ITEM-003",
},
{
"type": "flight",
"name": "Amsterdam → Stockholm",
"quantity": 2,
"amount_total": 45000,
"tax_total": 7820,
"amount": 22500,
"item_reference": "ITEM-004",
"booking_reference": "KL-20260601-AMS-ARN",
"departure": {"airport": "AMS", "date": "01-06-2026", "city": "Amsterdam", "country": "NL"},
"arrival": {"airport": "ARN", "city": "Stockholm", "country": "SE"},
"airline": "KL",
"price": 22500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [
{"first_name": "John", "last_name": "Smith"}
],
"insurances": [{"company": "AXA", "insurance_type": "CANCELATION", "amount": 2500, "currency": "EUR"}],
"affiliate": "ExamplePartner BV",
},
{
"type": "car",
"name": "7 days rental",
"quantity": 1,
"amount_total": 35000,
"tax_total": 6079,
"amount": 35000,
"item_reference": "ITEM-005",
"departure": {
"address": "Schiphol Airport",
"address2": "Terminal 3",
"postal": "1118CP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"date": "15-06-2026",
},
"arrival": {
"address": "Arlanda Airport",
"address2": "Terminal 5",
"postal": "19060",
"city": "Stockholm",
"region_code": "AB",
"country": "SE",
},
"car_rental_company": "Hertz",
"price": 35000,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [{"first_name": "John", "last_name": "Smith"}],
"insurances": [{"company": "Allianz", "insurance_type": "LOSS_DAMAGE_WAIVER", "amount": 1500, "currency": "EUR"}],
"affiliate": "example.com",
},
{
"type": "bus",
"name": "Amsterdam → Brussels Express",
"quantity": 1,
"amount_total": 2500,
"tax_total": 434,
"amount": 2500,
"item_reference": "ITEM-006",
"departure": {
"date": "15-06-2026",
"location": "Amsterdam",
"address": "Orlyplein",
"address2": "1",
"postal": "1043DP",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
},
"arrival": {
"address": "Rue du Progrès",
"address2": "80",
"postal": "1210",
"city": "Brussels",
"region_code": "BRU",
"country": "BE",
},
"bus_company": "FlixBus",
"price": 2500,
"currency": "EUR",
"class": "ECONOMY",
"passengers": [{"first_name": "John", "last_name": "Smith"}],
"insurances": [{"company": "AXA", "insurance_type": "CANCELATION", "amount": 500, "currency": "EUR"}],
"affiliate": "example.eu",
},
{
"type": "train",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL",
},
"arrival": {
"address": "Royal Quays",
"address2": "Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB",
},
"train_company": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{"first_name": "John", "last_name": "Smith"},
{"first_name": "Jane", "last_name": "Smith"},
],
"insurances": [
{"company": "Allianz", "insurance_type": "CANCELATION", "amount": 1000, "currency": "EUR"}
],
"affiliate": "example.eu",
},
{
"type": "ferry",
"name": "Amsterdam → Newcastle Ferry",
"quantity": 2,
"amount_total": 18000,
"tax_total": 3127,
"amount": 9000,
"item_reference": "ITEM-007",
"departure": {
"date": "20-06-2026",
"location": "IJmuiden Ferry",
"address": "Sluisplein",
"address2": "33",
"postal": "1975AG",
"city": "IJmuiden",
"region_code": "NH",
"country": "NL",
},
"arrival": {
"address": "Royal Quays, Coble Dene",
"address2": "Royal Quays, Coble Dene",
"postal": "NE29 6EA",
"city": "Newcastle",
"region_code": "ENG",
"country": "GB",
},
"ferry_line": "DFDS",
"price": 9000,
"currency": "EUR",
"class": "PREMIUM_ECONOMY",
"passengers": [
{"first_name": "John", "last_name": "Smith"},
],
"insurances": [
{"company": "Allianz", "insurance_type": "CANCELATION", "amount": 1000, "currency": "EUR"}
],
"affiliate": "example.eu",
},
{
"type": "hotel",
"name": "Hotel 1",
"quantity": 1,
"amount_total": 75000,
"tax_total": 13025,
"amount": 75000,
"item_reference": "ITEM-008",
"hotel_name": "Hotel",
"start_date": "01-06-2026",
"end_date": "04-06-2026",
"address": "Nes",
"address2": "49",
"postal": "1012KD",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"lodging_type": "ROOM",
"rooms": 1,
"price": 25000,
"currency": "EUR",
"guests": [{"first_name": "John", "last_name": "Smith"}, {"first_name": "Jane", "last_name": "Smith"}],
"host": {
"host_reference": "HOST-0042",
"type": "HOTEL",
"country": "NL",
"registration_date": "12-01-2015",
"reservations": 312,
},
"insurances": [
{"company": "Europ", "insurance_type": "CANCELATION", "amount": 3000, "currency": "EUR"}
],
"affiliate": "example.com",
},
{
"type": "voucher",
"name": "Gift Card",
"quantity": 1,
"amount_total": 5000,
"tax_total": 869,
"amount": 5000,
"item_reference": "ITEM-009",
"start_date": "01-06-2026",
"end_date": "01-06-2027",
"voucher_type": "GIFT_CARD",
"company": "example.com",
"affiliate": "example.nl",
},
{
"type": "insurance",
"name": "Travel",
"quantity": 1,
"amount_total": 4500,
"tax_total": 782,
"item_reference": "ITEM-010",
"company": "AXA",
"insurance_type": "MEDICAL",
"amount": 4500,
"currency": "EUR",
},
{
"type": "event",
"name": "Dance Event",
"quantity": 2,
"amount_total": 15000,
"tax_total": 2607,
"amount": 7500,
"item_reference": "ITEM-011",
"company": "ID&T",
"event_type": "FESTIVAL",
"start_date": "14-10-2026",
"end_date": "18-10-2026",
"venue_name": "Example Dome",
"access_controlled": True,
"address": "De Passage 100",
"address2": "De Passage 100",
"postal": "1101AX",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"insurances": [{"company": "AXA", "insurance_type": "CANCELATION", "amount": 1500, "currency": "EUR"}],
"affiliate": "example.nl",
},
{
"type": "marketplace",
"name": "Jacket",
"quantity": 1,
"amount_total": 12500,
"tax_total": 2172,
"amount": 12500,
"product_url": "https://marketplace.example.com",
"product_image": "https://marketplace.example.com",
"product_reference": "SKU-VLJ-001",
"item_reference": "ITEM-014",
"shipping_reference": "SHIP-002",
"seller": {
"reference": "SELLER-7890",
"name": "BV",
"address": "263",
"address2": "123",
"postal": "1016GV",
"city": "Amsterdam",
"region_code": "NH",
"country": "NL",
"registration": "15-03-2019",
"registration_updated": "10-01-2025",
"last_login": "16-04-2026",
"rating": "HIGH",
},
"product_category": "WOMEN_CLOTHING",
"line_item_references": ["ITEM-014"],
"shipping_references": ["SHIP-002"],
"number_of_transactions": 145,
"volume_of_transactions": 1875000,
},
]
},
"additional": {
"integration_metadata": {
"originators": [
"moduleName":"cosmoshopPlugin",
"moduleVersion":"2.1",
"name":"COSMO_GAMES_STORE",
"session_reference":"018b163d-0b83-7ba0-b837-da575d0ff824"
]
}
}
}
Extended list of supported parameters
This section provides an extended list of parameters to specify in purchase requests. Required parameters are listed in the section Format of requests for purchase processing.
| Parameter | Description | |
|---|---|---|
|
|
Object that contains additional information that may be relevant for payment processing in certain cases | 3 |
|
|
Object containing information about how the payment was technically initiated | 3-13 |
|
|
Array of objects containing information about the components used to initiate the payment (on the merchant's web service; up to six objects) | 3-1-13-1 |
|
|
Name of the service via which the payment was initiated, in the form of uppercase letters, digits, and underscores (_) instead of spaces (for example, COSMO_GAMES_STORE) |
3-1-23-1 |
|
|
Name of the technical module via which the payment was initiated, for example, cosmoshopPlugin |
3-1-33-1 |
|
|
Version number of the technical module via which the payment was initiated, for example, 2.1 |
3-1-43-1 |
|
|
Identifier of the operation or session within the web service, as a universally unique identifier version 7 (UUIDv7) in accordance with RFC 9562, for example, 018b163d-0b83-7ba0-b837-da575d0ff824 |
3-1-53-1 |
|
|
Token received from a payment system or provider and intended for secure interaction within a session (for example, Klarna Network Session Token) | 3-23 |
|
|
String object that contains specific information that can be used for ensuring interoperability between Klarna and it's partners. Information specified in this parameter can complement information specified in other parameters. The value length must be between 1 and 10240 characters (inclusive). The object must be formatted as follows: |
3-33 |
|
|
Object that contains customer data. | 1 |
|
|
Object with the customer's account information kept on file by the merchant. | 1-11 |
|
|
Indicates how the customer was authenticated during their most recent login to the web service. Can have one of the possible values:
|
1-1-11-1 |
|
|
Date and time of the customer's most recent account login in the DD-MM-YYYYhh:mm format |
1-1-21-1 |
|
|
Date of the most recent change to the account, except for the password change or password reset, in the DD-MM-YYYY format |
1-1-31-1 |
|
|
The account creation date in the DD-MM-YYYY format |
1-1-41-1 |
|
|
Array of objects containing information about previous purchases from the customer's device | 1-1-51-1 |
|
|
Number of purchases made in the last 12 months | 1-1-5-11-1-5 |
|
|
Number of paid purchases made in the last 12 months | 1-1-5-21-1-5 |
|
|
Number of purchases with disputes in the last 12 months | 1-1-5-31-1-5 |
|
|
Total amount of purchases made in the last 12 months, in the smallest units of the currency specified in the currency parameter of this same object |
1-1-5-41-1-5 |
|
|
Currency code for the specified amount in the ISO-4217 alpha-3 format | 1-1-5-51-1-5 |
|
|
Indicator of the type of payment instrument used, can have one of the following values:
|
1-1-5-61-1-5 |
|
|
Date and time of the customer's first purchase in the web service in the DD-MM-YYYYhh:mm format |
1-1-5-71-1-5 |
|
|
Date and time of the customer's last purchase in the web service in the DD-MM-YYYYhh:mm format |
1-1-5-81-1-5 |
|
|
Indicator of the customer's level in the merchant's web service loyalty program, converted to one of the following values:
|
1-1-61-1 |
|
|
Array of objects containing information about the customer's previous purchases | 1-1-71-1 |
|
|
Number of purchases made in the last 12 months | 1-1-7-11-1-7 |
|
|
Number of paid purchases made in the last 12 months | 1-1-7-21-1-7 |
|
|
Number of purchases with disputes in the last 12 months | 1-1-7-31-1-7 |
|
|
Total amount of purchases made in the last 12 months, in the smallest units of the currency specified in the currency parameter of this same object |
1-1-7-41-1-7 |
|
|
Currency code for the specified amount in the ISO-4217 alpha-3 format | 1-1-7-51-1-7 |
|
|
Indicator of the type of payment instrument used, can have one of the following values:
|
1-1-7-61-1-7 |
|
|
Date and time of the customer's first purchase in the web service in the DD-MM-YYYYhh:mm format |
1-1-7-71-1-7 |
|
|
Date and time of the customer's last purchase in the web service in the DD-MM-YYYYhh:mm format |
1-1-7-81-1-7 |
|
|
Object that contains customer identification document details | 1-21 |
|
|
The code of the country where the document serving as a proof of the customer's identity was issued. Specified in the ISO 3166-1 alpha-2 format. Example: |
1-2-11-2 |
|
|
Identification document number | 1-2-21-2 |
|
|
Array of objects containing shipping information, which may be relevant for individual alternative payment methods and may include the following information | 1-31 |
|
|
Basic information about the shipping address in the form of a street name and a house number | 1-3-11-3 |
|
|
Additional information about the shipping address in the form of the name of the district, information additional to the house number or other information | 1-3-21-3 |
|
|
Name of the shipping organization | 1-3-31-3 |
|
|
Name of the city (or other locality) in the shipping address | 1-3-41-3 |
|
|
Country code in the shipping address in the ISO 3166-1 alpha-2 format | 1-3-51-3 |
|
|
Email address | 1-3-61-3 |
|
|
First name of the recipient | 1-3-71-3 |
|
|
Last name of the recipient | 1-3-81-3 |
|
|
Phone number of the recipient, as a sequence of digits without separators | 1-3-91-3 |
|
|
Postal code in the shipping address | 1-3-101-3 |
|
|
Internal area code in the shipping address, representing the second part of the international area code (in the ISO 3166-2 format), without the two-letter country code and separating hyphen | 1-3-111-3 |
|
|
Shipping identifier within the web service or delivery service, required when specifying information about different deliveries in a single request | 1-3-121-3 |
|
|
Shipping type indicator, can have one of the following values:
|
1-3-131-3 |
|
|
Array of strings with a list of additional shipping parameter indicators, can have the following values:
|
1-3-141-3 |
|
|
Object that contains purchase data | 2 |
|
|
Indicator that specifies the type of a line item, that can have one of the following values:
|
2-12 |
|
|
Name of the item | 2-22 |
|
|
Cost of a unit of goods or services per item, in smallest currency units or as a hyphen (-) for items with the discount type |
2-32 |
|
|
Number of goods or services per item | 2-42 |
|
|
Total cost of goods or services per item, in smallest currency units or as a hyphen (-) for items with the discount type |
2-52 |
|
|
Amount of tax or fee included in the item price, in smallest currency units or as a hyphen (-) for items with the discount type |
2-62 |
|
|
Identifier of a product or service as defined by the web service | 2-72 |
|
|
Address of the web service page with the product or service card | 2-82 |
|
|
Image URL of the product or service | 2-92 |
|
|
Item identifier within the list of all purchased items | 2-102 |
|
|
The shipping identifier for an item as defined by a web service or shipping service | 2-112 |
|
|
Object that contains departure information | 2-122 |
|
|
Basic information about the departure address in the form of a street name and a house number | 2-12-12-12 |
|
|
Additional information about the departure address in the form of the name of the district, information additional to the house number or other information | 2-12-22-12 |
|
|
Departure date in the DD-MM-YYYY format |
2-12-32-12 |
|
|
Name of the city in the departure address | 2-12-42-12 |
|
|
Country code in the departure address in the ISO 3166-1 alpha-2 format | 2-12-52-12 |
|
|
Name of the departure location | 2-12-62-12 |
|
|
Postal code in the address of the departure location | 2-12-72-12 |
|
|
The internal code of the region (state, province, or other territorial area) in the address of the departure location, is the second part of the international area code (in the ISO 3166-2 format), without the two-letter country code and separating hyphen | 2-12-82-12 |
|
|
Three-letter code assigned to the departure airport by the International Air Transport Association (IATA) | 2-12-92-12 |
|
|
Object that contains arrival information | 2-132 |
|
|
Basic information about the arrival address in the form of a street name and a house number | 2-13-12-13 |
|
|
Additional information about the arrival address in the form of the name of the district, information additional to the house number or other information | 2-13-22-13 |
|
|
Arrival date in the DD-MM-YYYY format |
2-13-32-13 |
|
|
Name of the city in the arrival address | 2-13-42-13 |
|
|
Country code in the arrival address in the ISO 3166-1 alpha-2 format | 2-13-52-13 |
|
|
Postal code in the address of the arrival location | 2-13-62-13 |
|
|
The internal code of the region (state, province, or other territorial area) in the address of the arrival location, is the second part of the international area code (in the ISO 3166-2 format), without the two-letter country code and separating hyphen | 2-13-72-13 |
|
|
Three-letter code assigned to the arrival airport by the International Air Transport Association (IATA) | 2-13-82-13 |
|
|
Name of the organization providing bus transportation | 2-142 |
|
|
Name of the organization providing the rental car | 2-152 |
|
|
Name of the organization that operates the ferry service | 2-162 |
|
|
Two-letter code assigned to an airline by the International Air Transport Association (IATA) | 2-172 |
|
|
Name of the organization carrying out rail transportation | 2-182 |
|
|
Name of the partner organization providing the service | 2-192 |
|
|
Booking identifier (code) relevant for the flight | 2-202 |
|
|
Array of objects containing passenger information | 2-212 |
|
|
First name of the passenger | 2-21-12-21 |
|
|
Last name of the passenger | 2-21-22-21 |
|
|
Indicator that specifies the service class, can have one of the following values:
|
2-222 |
|
|
Array of objects containing insurance services information | 2-232 |
|
|
Indicator of the insurance service type, can have one of the following values:
|
2-23-22-23 |
|
|
Cost of the insurance service in the smallest units of currency specified in the currency parameter of the same object currency |
2-23-32-23 |
|
|
Cost of a ticket or reservation in the smallest units of currency specified in the currency parameter of the same object |
2-242 |
|
|
Currency code for the ticket, reservation or insurance service price in the ISO-4217 alpha-3 format | 2-252 |
|
|
Name of the accommodation (for example, of a hotel or a hostel) | 2-262 |
|
|
Object containing information about the rental property owner | 2-282 |
|
|
Rental type indicator:
|
2-28-12-28 |
|
|
Host identifier | 2-28-22-28 |
|
|
Country code in the host's address (legal address for a legal entity or residential address for an individual) in ISO 3166-1 alpha-2 format | 2-28-32-28 |
|
|
Registration date of the host in the DD-MM-YYYY format |
2-28-42-28 |
|
|
Number of reservations via the host over the past 12 months | 2-28-52-28 |
|
|
Indicator of the accommodation type, can have one of the following values:
|
2-292 |
|
|
Basic information about the accommodation address in the form of a street name and a house number | 2-302 |
|
|
Additional information about the accommodation address in the form of the name of the district, information additional to the house number or other information | 2-312 |
|
|
Name of the city in the accommodation address | 2-322 |
|
|
Country code in the accommodation address in the ISO 3166-1 alpha-2 format | 2-332 |
|
|
Postal code in the address of the accommodation location | 2-342 |
|
|
The internal code of the region (state, province, or other territorial area) in the address of the accommodation location, is the second part of the international area code (in the ISO 3166-2 format), without the two-letter country code and separating hyphen | 2-352 |
|
|
Number of accommodations being booked (for example, rooms or suites) | 2-362 |
|
|
Service start date (for example, check-in date) in the DD-MM-YYYY format |
2-372 |
|
|
Service end date (for example, check-in date) in the DD-MM-YYYY format |
2-382 |
|
|
Array of objects containing information about guests | 2-392 |
|
|
First name of the guest | 2-39-12-39 |
|
|
Last name of the guest | 2-39-22-39 |
|
|
Name of the organisation issuing the voucher or certificate or providing insurance services | 2-402 |
|
|
Indicator of the voucher or certificate type, can have one of the following values:
|
2-422 |
|
|
Indicator of the insurance service type, can have one of the following values:
|
2-442 |
|
|
Cost of the insurance service in the smallest units of currency specified in the currency parameter of the same object currency |
2-452 |
|
|
Event type indicator that can have one of the following values:
|
2-472 |
|
|
Name of the event venue (for example, the name of a park or conference hall) | 2-482 |
|
|
Indicator of the of digital access control to the service | 2-492 |
|
|
Object containing information about the seller on the marketplace | 2-502 |
|
|
Name or title of the seller on the marketplace | 2-50-12-50 |
|
|
Basic information about the seller's address in the form of a street name and a house number | 2-50-22-50 |
|
|
Additional information about the seller's address in the form of the name of the district, information additional to the house number or other information | 2-50-32-50 |
|
|
Name of the city where the seller is located | 2-50-42-50 |
|
|
Country code of the seller's location in the ISO 3166-1 alpha-2 format | 2-50-52-50 |
|
|
Postal code in the address of the seller's location | 2-50-62-50 |
|
|
Internal region code (state, province, or other territorial area) in the seller's address, representing the second part of the international area code (in the ISO 3166-2 format), without the two-letter country code and separating hyphen | 2-50-72-50 |
|
|
Seller's rating on the marketplace converted to one of the following values:
|
2-50-82-50 |
|
|
Date of seller registration on the marketplace in the DD-MM-YYYY format |
2-50-92-50 |
|
|
Date of last change to seller information in the DD-MM-YYYY format |
2-50-102-50 |
|
|
Date of last seller authentication on the marketplace in the DD-MM-YYYY format |
2-50-112-50 |
|
|
Seller identifier on the marketplace | 2-50-122-50 |
|
|
Number of payment operations via the intermediary through which the product is sold, over the last 12 months | 2-512 |
|
|
Amount of payment transactions with the intermediary through which the product is sold, over the last 12 months, in smallest currency units | 2-522 |
|
|
Product or service category indicator, can have one of the following values:
|
2-532 |
|
|
Array of web service page URLs with product or service descriptions | 2-542 |
|
|
Array of strings with a list of shipping identifiers for purchased items within a web service or delivery service | 2-552 |
Two-step purchase debiting request format
There are several things you need to consider when sending debiting requests by using the Klarna method:
- To initiate each debiting, send a separate POST request to the /v2/payment/klarna/capture endpoint.
- Each request must include the following objects and parameters:
- Object
general—general purchase information:project_id—project identifier obtained from Ecommpay during integrationpayment_id—payment identifier unique within the projectsignature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
- Object
payment—payment information:amount—payment amount in the smallest currency unitcurrency—payment currency code in the ISO-4217 alpha-3 format
- Array
purchase_data—information about the relevant bill items. The structure and format of the data specified in this parameter are the same as those described in the section Format of requests for purchase processing.
- Object
- The amount and currency must match the values in the authorisation request.
- Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Klarna method must contain the project identifier, basic payment information (identifier, amount, and currency code), relevant bill items information as well as signature.
{
"general": {
"project_id": 210,
"payment_id": "test_payment",
"signature": "PJkV8ej\/UG0Di8hTng6JvC7vQsaC6ta/9MTO8yJA=="
},
"payment": {
"amount": 1000,
"currency": "EUR"
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "Lenovo",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://example.com",
"product_image": "https://example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001",
}
]
}
{
"general": {
"project_id": 210,
"payment_id": "test_payment",
"signature": "PJkV8ej\/UG0Di8hTng6JvC7vQsaC6ta/9MTO8yJA=="
},
"payment": {
"amount": 1000,
"currency": "EUR"
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "Lenovo",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://example.com",
"product_image": "https://example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001",
}
]
}
Two-step purchase cancellation request format
There are several things you need to consider when sending purchase cancellation requests by using the Klarna method:
- To initiate each cancellation, send a separate POST request to one of the /v2/payment/klarna/cancel endpoint.
- Each request must include the following objects and parameters:
- Object
general—general purchase information:project_id—project identifier obtained from Ecommpay during integrationpayment_id—payment identifier unique within the projectsignature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
- Object
- Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Klarna method must contain the project and payment identifiers, as well as signature.
{
"general": {
"project_id": 580,
"payment_id": "TEST_15427033321774",
"signature": "9DRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...=="
}
{
"general": {
"project_id": 580,
"payment_id": "TEST_15427033321774",
"signature": "9DRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...=="
}
Formats of intermediate callbacks for customer redirection
Each payment made with the Klarna method requires redirection of customers from the merchant's web service to the Klarna service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the information details in the redirect_data object. The Klarna SDK (details) or the URL from the callback can be used to redirect the customer. The format of such callbacks is standard (details), and the following objects and parameters are included in the redirect_data object:
body—object with data to be sent in the request body, includes thepayment_request_idparameter containing data for redirecting the customer by using the Klarna SDK;method—parameter specifying the HTTP method for sending the request (GETorPOST)url—parameter containing a link for redirection
"redirect_data": { "body": { "payment_request_id": "krn:payment:eu1:request:e6bab34f" }, "method": "GET", "url": "https://pay.examople.com/eu/requests/92ba6a6b" },
Callback format
The Klarna method uses the standard format for callbacks to deliver purchase results. For more information, see Handling callbacks.
The following is the example of a callback with information about a 10.00 purchase made in the 442 project.
{
"project_id": 442,
"payment": {
"id": "EP696e-3aea",
"type": "purchase",
"status": "success",
"date": "2022-10-07T19:28:58+0000",
"method": "Klarna",
"sum": {
"amount": 1000,
"currency": "EUR"
},
"description": ""
},
"customer": {
"id": "12345"
},
"operation": {
"id": 33,
"type": "sale",
"status": "success",
"date": "2022-10-07T19:28:58+0000",
"created_date": "2022-10-07T19:28:14+0000",
"request_id": "a8ea69fdc5a83a2622-00000001",
"sum_initial": {
"amount": 1000,
"currency": "EUR"
},
"sum_converted": {
"amount": 1000,
"currency": "EUR"
},
"code": "0",
"message": "Success",
"provider": {
"id": 18052,
"payment_id": "1665170919576",
"auth_code": ""
}
},
"signature": "h14kSk782IZEgezTRpbZVe/54KGgd7mA=="
}
The following is the example of a callback with information about a declined purchase.
{
"project_id": 442,
"payment": {
"id": "EP1d27-e7ee",
"type": "purchase",
"status": "decline",
"date": "2022-10-10T09:28:33+0000",
"method": "Klarna",
"sum": {
"amount": 1500000,
"currency": "EUR"
},
"description": ""
},
"customer": {
"id": "12345"
},
"operation": {
"id": 38,
"type": "sale",
"status": "decline",
"date": "2022-10-10T09:28:33+0000",
"created_date": "2022-10-10T09:28:19+0000",
"request_id": "f56812a9270c19c04-00000001",
"sum_initial": {
"amount": 1500000,
"currency": "EUR"
},
"sum_converted": {
"amount": 1500000,
"currency": "EUR"
},
"code": "20000",
"message": "General decline",
"provider": {
"id": 18052,
"payment_id": "",
"auth_code": ""
}
},
"signature": "ZS90VEL4x5avOhc4MG85STSog=="
}
Useful links
The following articles can be useful when implementing purchases via Gate:
- Interaction concepts—how to organise interaction with the payment platform by using Gate
- Signature generation and verification—about the procedure of creating and verifying signatures in requests and callbacks.
- Payment processing—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Gate.
- Handling operation processing information—about error and response codes that are used in the payment platform to record information about performing of operations.
Refunds by using Gate
General information
To perform a refund through Gate by using the Klarna method, send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result. The full sequence and special aspects of refund performing are provided below.
- A customer initiates a refund.
- The web service sends the request for performing the refund by using Gate to the specified Ecommpay URL.
- The payment platform receives the request.
- The payment platform validates the required parameters and signature in the request.
- The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
- The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Klarna service.
- The refund is processed on the side of the Klarna service.
- The Klarna service sends the result notification to the payment platform.
- The payment platform sends the result callback to the web service.
- The customer receives the refund result information from the web service.
Information about the formats of requests and callbacks used for performing refunds by using the Klarna method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
Request format
There are several things you need to consider when sending refund requests by using the Klarna method:
- To initiate each refund, send a POST request to the /v2/payment/refund endpoint.
- Each request must include the following objects and parameters:
- Object
general—general request information:project_id—project identifier obtained from Ecommpay during integrationpayment_id—identifier of the payment that needs to be refundedpayment identifiersignature—request signature created after all required parameters are specified (details—in the Signature generation and verification)
- Object
payment—refund information:description—refund description or commentamount—refund amount in the smallest currency unit (required for a partial refund)currency—refund currency code in the ISO-4217 alpha-3 format (required for a partial refund)
- Object
customer—customer information:ip_address—customer IP address relevant for the initiated refund
- Array
purchase_data—information about the bill items for which a refund must be initiated (for a full refund, all items for which a purchase was processed or authorisation hold was applied must be specified).The structure and format of the data specified in this parameter are the same as those described in the section Purchases by using Gate.
- Object
- Additionally, any other parameters included in the specification can be used.
Thus, a correct refund request by using the Klarna method must contain the project and payment identifiers, description of the refund, the customer IP address, bill items information, signature, and, if necessary, currency code and refund amount.
{
"general": {
"project_id": 210,
"payment_id": "test_payment",
"signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
},
"payment": {
"description": "test refund",
"amount": 1000,
"currency": "EUR"
},
"customer": {
"ip_address": "192.0.2.0"
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "Lenovo",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://example.com",
"product_image": "https://example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001",
}
]
}
{
"general": {
"project_id": 210,
"payment_id": "test_payment",
"signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
},
"payment": {
"description": "test refund",
"amount": 1000,
"currency": "EUR"
},
"customer": {
"ip_address": "192.0.2.0"
},
"purchase_data": {
"positions": [
{
"type": "product",
"name": "Lenovo",
"quantity": 1,
"amount_total": 189900,
"tax_total": 32958,
"amount": 189900,
"product_url": "https://example.com",
"product_image": "https://example.com",
"product_reference": "SKU-LEN-X1G12",
"item_reference": "ITEM-001",
"shipping_reference": "SHIP-001",
}
]
}
Callback format
The Klarna method uses the standard format for callbacks to deliver refund results. For more information, see Handling callbacks.
The following is the example of a callback with information about a 3.00 EUR partial refund made in the 442 project.
{
"project_id": 442,
"payment": {
"id": "EP8806-91ba",
"type": "purchase",
"status": "partially refunded",
"date": "2022-10-10T13:21:33+0000",
"method": "Klarna",
"sum": {
"amount": 300,
"currency": "EUR"
},
"description": ""
},
"customer": {
"id": "12345"
},
"operation": {
"id": 46,
"type": "refund",
"status": "success",
"date": "2022-10-10T13:21:33+0000",
"created_date": "2022-10-10T13:21:23+0000",
"request_id": "b132a7883e19d0fe21b8fd1-00000001",
"sum_initial": {
"amount": 700,
"currency": "EUR"
},
"sum_converted": {
"amount": 700,
"currency": "EUR"
},
"code": "0",
"message": "Success",
"provider": {
"id": 18052,
"payment_id": "1665408090952",
"auth_code": ""
}
},
"signature": "7upYXNzrL/tQfYO0rwjvkc9LbDPkwSw=="
}
The following is the example of a callback with information about a refund declined as the amount in the refund requested is greater than the amount in the initial payment.
{
"project_id": 211,
"payment": {
"id": "refund_02",
"type": "purchase",
"status": "success",
"date": "2019-02-19T14:25:25+0000",
"method": "Klarna",
"sum": {
"amount": 100000,
"currency": "EUR"
},
"description": "test_02"
},
"account": {
"number": "035209875690435"
},
"operation": {
"id": 14153000003282,
"type": "refund",
"status": "decline",
"date": "2019-02-19T14:25:25+0000",
"created_date": "2019-02-19T14:25:24+0000",
"request_id": "9d11b2ca618ec3ba0f5fa58f174",
"sum_initial": {
"amount": 100000,
"currency": "EUR"
},
"sum_converted": {
"amount": 100000,
"currency": "EUR"
},
"provider": {
"id": 1169,
"payment_id": "105887607",
"date": "2019-02-19T14:25:24+0000",
"auth_code": ""
},
"code": "3283",
"message": "Refund amount more than init amount"
},
"signature": "of8k9xerKSKpFBR4XL0Sf/7eg=="
}
Useful links
The following articles can be useful when implementing refunds via Gate:
- Interaction concepts—how to organise interaction with the payment platform by using Gate
- Signature generation and verification—about the procedure of creating and verifying signatures in requests and callbacks.
- Payment processing—about the types, processing models, and possible statuses of supported payments and operations.
- Purchase refunds—about performing of refunds by using Gate.
- Handling operation processing information—about error and response codes that are used in the payment platform to record information about performing of operations.
Refunds by using Dashboard
When working with Dashboard, you can perform single and mass refunds by using the Klarna method.
- To perform a single refund, select the target purchase, open its information tab, specify the amount of the refund, send a request and verify that the refund has been performed.
-
To perform a mass refund, prepare and upload a file with information about all target refunds, send a batch request, and verify that the refunds have been performed.
Use a CSV file structured according to the requirements presented in the Mass payments data section. The refund parameters must comply with the requirements (you do not have to generate a signature because it is specified by Dashboard).
More information Information about performing refunds by using Dashboard is presented in a separate section.
Analysis of payments results
To analyse information about payments made with the Klarna method as well as other methods, you can use:
- Dashboard interface toolkit with various lists and analytic panels.
- Reports in CSV file format, available via the Reports section (one-time and periodically).
- Data in JSON format, sent by program requests to a specified URL available by using the Data API interface.
If you have any questions, refer to the documentation (Dashboard and Using Data API) and Ecommpay technical support.