API Guide
An Application Programming Interface (API) is an interface implemented in a software program which enables it to communicate with other software according to a particular set of rules.
In this case it is your store, business system or other system which communicates with Klarna Online.
- Read more about how our API works
The API takes the information from the e-store and makes a signal
which is sent to Klarna through the Internet.
Klarna receives the signal and translates it to information which is
worked over in our system. For example, if it is a purchase, we will
read the information and make a credit assessment.
Klarna responds back through the web with a signal to the API which translates it to information that the e-store can read. The e-store
system reads the response and acts upon it. In our example this would mean that it shows a response the customer. Either the purchase is accepted and order completed or the purchase is denied. - What is the difference between the 4.1 and 4.0 API?
We released a new version of our API which carries the proto_vsn variable 4.1 (not to be confused with the API version which was upgraded to 2.x when the code was changed to object oriented). This new prototype version brings a few new features like the fraud flag and some reworked functions. For a complete list of the changes and an in-depth comparison of the old and new api click here (will open in new window)
Integration
There are two ways of integrating Klarnas services: standard and advanced integration. Which of the two you should choose depends on which estore platform you have and what your processes look like.
The key difference is that the advanced version allows you to seamlessly make changes in orders before delivery. The standard version also offers great possibility to automate your work flow, but it has some limitations compared to the advanced one. Not all stores need this funtionality and since you do not have to integrate your business system it is usually a bit faster to integrate.
The advanced integration is a complete integration and when setup your business system handles invoice, part payment and mobile purchases effortlesly. It requires that your business system can make requests using one of our API's (batch is also available) to Klarna Online when an order is dispatched.
Depending on the integration type you also have different possibilities of handling the orders in our web interface Klarna Online.
See table further down this page for more information on functionality.
Flow Charts
These flow charts describe the order flow from the homepage to the delivery and distribution of the invoice. The process and integration is very similar for Klarna invoice and part payment. It differs for Klarna mobile.
Standard integration
- The customer makes a purchase online
When the customer has chosen Klarna invoice or part payment as their way of payment, information about the purchase is sent to us through the add_transaction request. Klarna will make a credit assessment of the purchase and immediately answer back to the store. Should the purchase be declined we will return with an error message that is displayed to the customer. When the purchase is accepted, a passive invoice is created in Klarnas system. It is an invoice without a due date.

- Activation of purchase when the order is sent
This is done when the goods are to be sent to the customer. Activation means that the store activates the purchase which gives it a due date (usually 14 days for invoice). This can be done with two simple clicks in Klarna Online or through function calls.

- Distribution of invoices
This is done by mail, email or printout (if you wish to place the invoice with the package) and can be done either via Klarna Online or through function calls.
When a part payment purchase is shipped, Klarna will automatically take care of the sendouts of the monthly invoices. This means that you as a merchant only has to focus on shipping the goods and let Klarna take care of the payments.

Advanced integration
- The customer makes a purchase online
When the customer has chosen Klarna invoice or part payment as their way of payment information about the purchase is sent to us through reserve_amount. We will make a credit assessment of the purchase and answer back to the store immediately. Should the purchase be declined we will return with an error message which is displayed to the customer. The key difference here is that the reserve_amount-request creates a reservation with the amount of the order (hence the name) while add_transaction creates a passive invoice containing items that have been ordered. The benefits of this will be evident in the next step.

- Activation of the purchase when the order is sent
This is done when the goods are to be sent to the customer. When this happens the store uses the function activate_reservation which transforms the reservation to an invoice or part payment purchase with a due date (usually 14 days for invoice).
The nice part of doing it this way is when there have been changes in the order from the time of order (on the web) till it's time to ship. Examples of this is when not all goods are in stock. What happens is that the store sends the list of the shipped goods to Klarna (lets say 2 out of 3 goods) and out of this information Klarna creates the final invoice. This can also be done with the standard integration using update_goods_qty to modify the passive invoice, however it is usually simpler to use the advanced integration.
If we continue with the example we have two options: either that we are not going to ship the last item (because we will not restock it) or that we are going to ship it later. If store decides for the latter, it must add flag 16 to the activate_reservation call which holds the remaining part of the reservation that can be used later when you have received the remaining items.

- Distribution of invoice
This is done by mail, email or printout (if you wish to place the invoice with the package) and can be done either via Klarna Online or through function calls.
When an account purchase is activated Klarna will automatically take care of the sendouts of the monthly invoices. This means that you as a merchant does not need to add any sendouts to ours.

Functionality
| Standard integration | Advanced integration | |||
| API | Klarna online | API | Klarna Online | |
| Create an order |
|
|
|
|
| Change order before delivery |
|
|
|
|
| Activate invoice when order is ready for delivery |
|
|
|
|
| Cancel order before delivery |
|
|
![]() |
|
| Handle returns |
|
|
|
|
| Send invoice by postage or/and e-mail |
|
|
|
|
| Activate part of purchase |
|
|
![]() |
|
| Separate invoice- and delivery address | ![]() |
![]() |
|
|
| Supports batch files containing delivered orders | ![]() |
|
||

Step by Step