Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Notes to type of payment
Payment Type | Countries | Currency | B2C | B2B |
---|---|---|---|---|
Invoice |
|
| yes | no |
Installment |
|
| yes | no |
API-Requests - special notes / deviations
Overview of deviations
UI Text Box | ||
---|---|---|
| ||
|
Clearingtype / Clearingsubtype
clearingtype | fnc | Klarna payment types are handled as a financing payment |
financingtype | KLS | Klarna Installment |
financingtype | KLV | Klarna Invoice |
Summary
Klarna Checkout is divided in 3 steps.
UI Steps | ||||
---|---|---|---|---|
|
- creating a new session via our server api
- optional: updating the session
- token-handling via klarna checkout .js
- finalizing the checkout ((pre-)authorization) via our server api
Creating a new session via our server api
In the first step you need to setup a new checkout session. You can do so by sending a genericpamynet-request to our server api as listed below.
Please make sure to send the customer data within this request as they're needed to initiate a new session.
→ Genericpayment start_session
Optional update session
If the customer leaves the checkout page and comes back later, you can update the created session and change for example the address data.
→ Genericpayment update_session
Token-handling via Klarna Widget
Part of the response is a client token. This token needs to be passed to the Klarna Widget. This Widget sends the client token together with the selected payment method (e.g. "Klarna Pay Later") to Klarna to get a authorization token.
Finalizing the checkout ((pre-)authorization) via our server api
In the last step, you need to send the authorization token received by Klarna widget as part of the (pre-)authorization request to our server api.
→ Preauthorization/Authorization
UI Text Box | ||
---|---|---|
| ||
The response contains a redirect-URL. You need to redirect the customer to this url, so that Klarna is able to securely handle data and optimize purchase flow. |
Anchor | ||||
---|---|---|---|---|
|
Genericpayment start_session
Request "generic start session" | |||
API parameter | Required | Format | Comments |
---|---|---|---|
add_paydata[action] | + | Default | Fixed value "start_session" |
add_paydata[session_id] | o | Default | Fixed value "start_session" |
add_paydata[merchant_data] | - | BASE 64 String | "EMD" - Extra Merchant Data - means that integration with any such package depends on (i) merchant’s offering and (ii) merchant’s technical possibilities. It is not to be interpreted in such a way that EMD is not required at all. |
firstname | + | AN..50 | Mandatory - and can not be substituted by usage of company |
lastname | + | Mandatory - and can not be substituted by usage of company | |
street | + | Mandatory - full address is required and must match the shipping-address | |
zip | + | Mandatory - full address is required and must match the shipping-address | |
city | + | Mandatory - full address is required and must match the shipping-address | |
country | + | Mandatory - full address is required and must match the shipping-address | |
addressaddition | + | Mandatory for NL | |
shipping-address | - | Shipping-address parameters should not be used at all. If shipping-address is used it must be the same as the invoice address ! | |
gender | o | Mandatory for Germany, Netherlands and Austria | |
ip | + | Mandatory | |
+ | Mandatory | ||
telephonenumber | + | Mandatory | |
birthday | o | Mandatory for Germany, Netherlands and Austria | |
add_paydata[last_four_ssn] | - | Last four digits for customer social security number. | |
add_paydata[organization_entity_type] | - | Only relevant for B2B transactions. | |
personalid | o | Mandatory for Sweden, Finland, Denmark and Norway | |
it[n], id[n], pr[n], no[n], de[n], va[n] | + | The complete shopping cart must be specified. | |
add_paydata[klsid] | o | Mandatory for Klarna Installment (KLS): Campaign code |
Anchor | ||||
---|---|---|---|---|
|
Genericpayment update_session
To update an order, you need to send a genericpayment-request with action=update. The call needs to provide the new list of items representing the complete shopping cart.
UI Text Box | ||
---|---|---|
| ||
|
Request "genericpayment - update" | ||
API parameter | Required | Comments |
---|---|---|
add_paydata[action] | + | Fixed value "update" |
add_paydata[reservation_txid] | + | Referencing the reservation (received from authorization.response -> add_paydata[reservation_txid]) |
workorderid | + | Referencing the reservation (received from authorization.response -> add_paydata[workorderid]) |
country | + | |
amount | + | |
currency | + | |
financingtype | + | Fixed value "KLV" |
it[n], id[n], pr[n], no[n], de[n], va[n] | + | The complete shopping cart is mandatory |
Response "genericpayment - update" | ||
API parameter | Required | Comments |
---|---|---|
status | + | APPROVED / ERROR |
APPROVED | ||
workorderid | + | |
ERROR | ||
errorcode | + | |
errormessage | + | |
customermessage | + |
Anchor | ||||
---|---|---|---|---|
|
Klarna Widget
Widget Description here
Anchor | ||||
---|---|---|---|---|
|
Preauthorization/Authorization
Request "preauthorization / authorization" | ||
API parameter | Required | Comments |
---|---|---|
firstname | + | Mandatory - and can not be substituted by usage of company |
lastname | + | Mandatory - and can not be substituted by usage of company |
street | + | Mandatory - full address is required and must match the shipping-address |
zip | + | Mandatory - full address is required and must match the shipping-address |
city | + | Mandatory - full address is required and must match the shipping-address |
country | + | Mandatory - full address is required and must match the shipping-address |
addressaddition | + | Mandatory for NL |
shipping-address | - | Shipping-address parameters should not be used at all. If shipping-address is used it must be the same as the invoice address ! |
gender | o | Mandatory for Germany, Netherlands and Austria |
ip | + | Mandatory |
+ | Mandatory | |
telephonenumber | + | Mandatory |
birthday | o | Mandatory for Germany, Netherlands and Austria |
personalid | o | Mandatory for Sweden, Finland, Denmark and Norway |
it[n], id[n], pr[n], no[n], de[n], va[n] | + | The complete shopping cart must be specified. |
add_paydata[klsid] | o | Mandatory for Klarna Installment (KLS): Campaign code |
Response "preauthorization / authorization" | ||
API parameter | Required | Comments |
---|---|---|
add_paydata[workorderid] | + | Klarna Invoice: Workorder ID, used for update calls |
add_paydata[reservation_txid] | + | Klarna Invoice: Reservation ID, used for update calls |
Capture
Request "capture" | ||
API parameter | Required | Comments |
---|---|---|
capturemode | + | Parameter capturemode is mandatory to indicate whether this capture will be the last one. |
settleaccount | + | Parameter settleaccount is mandatory to indicate whether a refund to the customer should be initiated. |
Response "capture" | ||
API parameter | Required | Comments |
---|---|---|
clearing_instructionnote | o |
|
Debit / Refund
Request "debit" | ||
API parameter | Required | Comments |
---|---|---|
settleaccount | + | Parameter settleaccount is mandatory to indicate whether a refund to the customer should be initiated. |
Table of Contents |
---|