Now it's time to start integrating the example files (or work directly with the API) into your e-store's code. Your e-store is place in "test mode" as default, which we recommend that you keep until you're certain everything works perfectly.

Use the test persons/companies below with the use cases to make sure that the XML/RPC connection works properly. NB! All purchases with test persons will be created as test invoices even if the test mode is switched off. For further explanation of the function calls, go to API functions page (opens in a new window).

Example files

In the API packages you can find example files with ready made code which will make easy for you to get started.

Use Cases

Test persons

Invoice purchase
  1. Make a get_addresses call
  2. Make a reserve_amount call
  3. Make a activate_reservation call
Do these functions with all test persons

Consumer credit purchase
  1. Calculate periodic_cost using the pclasses file. To get the complete file, contact Klarna support.
  2. Calculate monthly_cost
  3. Make a get_addresses call
  4. Make a reserve_amount call using the pclass and yearly salary variables
  5. Make a activate_reservation call using the pclass and yearly salary variables


Please observe that all part payment purchases made in test mode, will be created as invoices.

Invoice purchase
  1. Make a reserve_amount call
  2. Make a activate_reservation call
Do these functions with all test persons

Consumer credit purchase
  1. Calculate monthly cost with the calc_monthly_cost function using the pclasses file. You can download the pclasses file from Klarna Online.
  2. Make a reserve_amount call using the pclass.
  3. Make a activate_reservation call using the pclass.
Yearly salary is only used for purchases in Denmark

Please observe that all part payment purchases made in test mode, will be created as invoices.

Social security number: 531109-6845
Name: Maud Johansson
Address: Köpmang 7
12149 Johanneshov

Social security number: 430415-8399
Name: Karl Lidin
Address: Junibacksgatan 42
23634 Hollviken

Maud has a record of non-payments. Carl has not, and has also unlimited credit.

Company registration number: 6020310139
Company name: Kalle Anka AB
Address 1: Storgatan 1
12345 Ankeborg
Address 2: Lillgatan 99
77777 Ankeborg

Company registration number: 6720217931
Company name: Björnligan AB
Address 1: Fulgatan 1
12345 Ankeborg
Adress 2: Bakgatan 99
77777 Ankeborg

Björnligan AB has a record of non-payments. Kalle Anka AB has not, and has also unlimited credit.
Social security number: 010130-887T
Name: Mikael Miehinen
Address: Tikkuritie 11
01370 Vantaa

Social security number: 230246-8989
Name: Suvi Aurinkoinen
Address: Planeettatie 2
01450 Vantaa

Mikael has a record of non-payments, Suvi has not.

Company registration number: 07527622
Company name: Mankalan Perhekodit Oy
Address 1:Porrassalmenkatu 19 B
50100 Parikkala
Address 2: Kanttorinkatu 11
59100 Iitti

Company registration number: 10891871
Company name: Porin Mies-Laulu r.y.
Address 1: Vapaudenkatu 10
28100 Pori

Mankalan Perhekodit Oy has a record of non-payments. Porin Mies-Laulu r.y. has not.
Social security number: 0505610059
Name: Rasmus Jens-Peter Lybert
Address: Godthåbvej 8,-2
3900 Godthåb

Company registration number: 27968880
Company name: Onbase ApS
Address: Centrumgaden 37
2750 Ballerup
Social security number: 18106500157
Name: Petter Testmann
Address: Hundremeterskogen 100
0563 Oslo

Social security number: 18106500076
Name: Petra Testdame
Address: Sofienberggate 56
0563 Oslo

Petra Testdame has payment remarks.
Gender: Male
Birth date: 07071960
Name: Uno Vier
Address: Hellersbergsstrasse 14
41460 Neuss
Gender: Male
Birth date: 19700701
Name: Test Persoon
Address: Neherkade 1
2521VA Gravenhage