reserveAmount

Purpose:

To reserve a purchase amount for a specific customer. The reservation is valid, by default, for 7 days.

Please note: Activation must be done with activateReservation , i.e. you can't activate through Klarna Online.

Return value:

Array - [rno, invoiceStatus]
The value of "rno" is the reservation number for the purchase.
The value of "invoiceStatus" shows if the invoice can be delivered immediately or requires manual approval.
1 = OK
2 = Pending

or

Throws an exception with error code and error message.

Code examples

Please note that you can find more code examples in our API-files which you will find under Download API in the left menu.

The code examples have been divided into several steps. Click on the step you would like to see the code example.
1. Initialize and setup the Klarna instance
$k = new Klarna();

$k->config(
    123456,               // Merchant ID
    'sharedSecret',       // Shared Secret
    KlarnaCountry::SE,    // Country
    KlarnaLanguage::SV,   // Language
    KlarnaCurrency::SEK,  // Currency
    Klarna::BETA,         // Server
    'json',               // PClass Storage
    '/srv/pclasses.json', // PClass Storage URI path
    true,                 // SSL
    true                  // Remote logging of response times of xmlrpc calls
);
2. Add the article(s), shipping and/or handling fee.
//Here we add a normal product to our goods list.
$k->addArticle(
    4,                      // Quantity
    "MG200MMS",             // Article number
    "Matrox G200 MMS",      // Article name/title
    299.99,                 // Price
    25,                     // 25% VAT
    0,                      // Discount
    KlarnaFlags::INC_VAT    // Price is including VAT.
);

//Next we might want to add a shipment fee for the product
$k->addArticle(
    1,
    "",
    "Shipping fee",
    14.5,
    25,
    0,
    // Price is including VAT and is shipment fee
    KlarnaFlags::INC_VAT | KlarnaFlags::IS_SHIPMENT
);

// Lastly, we want to use an invoice/handling fee as well
$k->addArticle(
    1,
    "",
    "Handling fee",
    11.5,
    25,
    0,
    // Price is including VAT and is handling/invoice fee
    KlarnaFlags::INC_VAT | KlarnaFlags::IS_HANDLING
);
3. Create and set the address(es).
//Create the address object and specify the values.
$addr = new KlarnaAddr(
    'always_approved@klarna.com', // email
    '',                           // Telno, only one phone number is needed.
    '0762560000',                 // Cellno
    'Testperson-se',              // Firstname
    'Approved',                   // Lastname
    '',                           // No care of, C/O.
    'Stårgatan 1',                // Street
    '12345',                      // Zip Code
    'Ankeborg',                   // City
    KlarnaCountry::SE,            // Country
    null,                         // HouseNo for German and Dutch customers.
    null                          // House Extension. Dutch customers only.
);

// Next we tell the Klarna instance to use the address in the next order.
$k->setAddress(KlarnaFlags::IS_BILLING, $addr);  // Billing / invoice address
$k->setAddress(KlarnaFlags::IS_SHIPPING, $addr); // Shipping / delivery address
4. Specify relevant information from your store. (OPTIONAL)
// Set store specific information so you can e.g. search and associate invoices
// with order numbers.
$k->setEstoreInfo(
    '175012',       // Order ID 1
    '1999110234',   // Order ID 2
    ''              // Optional username, email or identifier
);

// If you don't have the order id available at this stage, you can later use the
// method updateOrderNo().
5. Set additional information. (OPTIONAL)
/** Comment **/

$k->setComment('A text string stored in the invoice commentary area.');

/** Shipment type **/

// Normal shipment is defaulted, delays the start of invoice expiration/due-date.
$k->setShipmentInfo('delay_adjust', KlarnaFlags::EXPRESS_SHIPMENT);
6. Invoke reserveAmount and transmit the data.
try {
    // Transmit all the specified data, from the steps above, to Klarna.
    $result = $k->reserveAmount(
        '4103219202', // PNO (Date of birth for DE and NL).
        null,       // Gender.
        // Amount. -1 specifies that calculation should calculate the amount
        // using the goods list
        -1,
        KlarnaFlags::NO_FLAG,   // Flags to affect behavior.
        // -1 notes that this is an invoice purchase, for part payment purchase
        // you will have a pclass object on which you use getId().
        KlarnaPClass::INVOICE
    );

    //Check the order status
    if ($result[1] == KlarnaFlags::PENDING) {
        /* The order is under manual review and will be accepted or denied at a
           later stage. Use cronjob with checkOrderStatus() or visit Klarna
           Online to check to see if the status has changed. You should still
           show it to the customer as it was accepted, to avoid further attempts
           to fraud.
         */
    }

    // Here we get the reservation number
    $rno = $result[0];

    echo "status: {$result[1]}\nrno: {$result[0]}\n";
    // Order is complete, store it in a database.
} catch(Exception $e) {
    // The purchase was denied or something went wrong, print the message:
    echo "{$e->getMessage()} (#{$e->getCode()})\n";
}
The code examples have been divided into several steps. Click on the step you would like to see the code example.
1. Initialize and setup the Klarna instance
            API klarna = new API ();

            /** Configure the Klarna object **/
            klarna.Config (new KlarnaConfig () {
                EID = 123456,
                Secret = "sharedsecret",
                Country = API.Country.Sweden,
                Language = API.Language.Swedish,
                Currency = API.Currency.SEK,
                Encoding = API.Encoding.Swedish,
            // API.KlarnaServer.Beta or API.KlarnaServer.Live, depending
            // on which server your eid is associated with
                Mode = API.KlarnaServer.Beta,
                PCStorage = "xml",
                PCURI = @"/tmp/pclasses.xml"
            });

            //It's important that we set the end customers IP
            klarna.ClientIP = "192.0.2.9";

            // We are phasing out the previously used argument sessionId.
            // You no longer need to implement the checkouthtml on your site
            // but we still require a sessionId. In the future this argument
            // will be completely removed but for now it needs to be set.

            // To do this we will set it manually
            int eid = 0; //Use the same estore id that was set up in the config
            ThreatMetrix tm = new ThreatMetrix (eid);
            SessionID sid = new SessionID ();
            sid.DeviceID1 = tm.SessionID;
            klarna.SessionID = sid;
2. Add the article(s), shipping and/or handling fee
            //Here we add a normal product to our goods list
            klarna.AddArticle (
                4, //Quantity
                "1234e", //Article number
                "Matrox G200 MMS", //Article name/title
                299.99, //Price
                25, //VAT in %
                0, //Discount in %
                API.GoodsIs.IncVAT
            );

            //Here we add a shipment fee for the product
            klarna.AddArticle (
                1,
                "",
                "Shipment fee",
                20.0,
                25,
                0,
                API.GoodsIs.Shipping | API.GoodsIs.IncVAT
            );

            //Lastly, we want to use an invoice/handling fee as well
            klarna.AddArticle (
                1,
                "",
                "Handling fee",
                10.0,
                25,
                0,
                API.GoodsIs.Handling | API.GoodsIs.IncVAT
            );
3. Create and set the address(es)
            //Next we tell the Klarna instance to use the address in the next order.
            //We start by specifying the shipping address:
            ShippingAddress shippingAddress = new ShippingAddress (
                "pending_approved@xxxxxx.xxx", //Email address
                "", //Normal land line phone, we can skip this. Only one phone number needed
                "0765260000", //Cellphone number
                "Testperson-se", //First name
                "Approved", //Last name
                "", // C/O, Care of
                "Stårgatan 1", //Street address. For DE and NL specify street number in houseNumber
                "12345", //ZipCode
                "Ankeborg", //City
                API.Country.Sweden, //Country
                "", //House number
                "", //House exentions
                "" //Company name
            );

            //And then the billing address:
            BillingAddress billingAddress = new BillingAddress (
                "pending_approved@xxxxxx.xxx", //Email address
                "", //Normal land line phone, we can skip this. Only one phone number needed
                "0765260000", //Cellphone number
                "Testperson-se", //First name
                "Approved", //Last name
                "", // C/O, Care of
                "Stårgatan 1", //Street address. For DE and NL specify street number in houseNumber
                "12345", //ZipCode
                "Ankeborg", //City
                API.Country.Sweden, //Country
                "", //House number
                "", //House exentions
                "" //Company name
            );

            //Set the addresses to our Klarna object
            klarna.SetAddresses (shippingAddress, billingAddress);
4. Invoke ReserveAmount and transmit the data
            try {
                string[] result = klarna.ReserveAmount (
                    "410321-9202", // Personal Number. Use date of birth for DE / NL
                    null, //Gender
                    2000.0, //Amount to reserve
                    API.Flag.NoFlag, // Control specific behaviour  e.g. API.Flag.RSRVSendByMail
                    (int)API.Flag.PclassInvoice, // API.Flag.PclassInvoice (-1) notes that this is an invoice purchase. For part payment purchase you will have a pclass which you use pclass.PClassID from.
                    API.Encoding.Swedish //Encoding to use.
                );

                //Get the invoiceStatus:
                API.OrderStatus invoiceStatus = (API.OrderStatus)Convert.ToInt32 (result [1]);
                if (invoiceStatus == API.OrderStatus.Accepted) {
                    //The order is accepted
                    Console.WriteLine ("Accepted");
                } else if (invoiceStatus == API.OrderStatus.Denied) {
                    //The order is denied
                    Console.WriteLine ("Denied");
                } else {
                    /* The order is under manual review and will be accepted or denied at a later stage.
                      Use cronjob with CheckOrderStatus() or visit Klarna Online to check to see if the status has changed.
                      You should still show it to the customer as it was accepted, to avoid further attempts to fraud. */
                    Console.WriteLine ("Pending");
                }

                //Here we get the reservation number:
                string reservationnr = result [0];
                Console.WriteLine (reservationnr);
            } catch (Exception e) {
                //Something went wrong, print the error:
                Console.WriteLine ("Error: " + e.Message);
            }
The code examples have been divided into several steps. Click on the step you would like to see the code example.
1. Initialize and setup the Klarna instance
        Klarna k = new Klarna();

        /*
         *  Configure the Klarna object using the config() method. (Alternative 1)
         */

        /* KlarnaConfig conf = new KlarnaConfig();
        
        // Define values:
        conf.setEid(0);                         // Merchant ID or Estore ID, an Integer above 0.
        conf.setSecret("sharedSecret");         // The shared secret which accompanied your eid.
        conf.setCountry(KlarnaCountry.DE);      // The country of your store.
        conf.setLanguage(KlarnaLanguage.DE);    // The language of your store.
        conf.setCurrency(KlarnaCurrency.EUR);   // The currency of your store.
        conf.setMode(Klarna.BETA);              // or Klarna.LIVE when you are ready to go live.
        
        // Define pclass settings:
        conf.setPcStorage("json");              // Storage module. Currently only json is supported.
        conf.setPcURI("/srv/pclasses.json");    // Where the json file for the pclasses are stored.
        
        // Should we use SSL?
        conf.setSsl(false);
        
        // Should we error report/status report to klarna.
        conf.setCandice(true);                  // set to false if your server doesn't support UDP
        
        // Do we want to see normal debug information?
        conf.setDebug(null);                    // true to debug, null or false not to debug
        // Set the config object.
        k.config(conf);
        
         */


        /* 
         *  Configure the Klarna object using the config() method (Alternative 2)
         */

        /*
         *   k.config(0,                     // e-store ID
         *           "sharedSecret",         // shared secret
         *           KlarnaCountry.DE,       // Country constant
         *           KlarnaLanguage.DE,      // Language constant
         *           KlarnaCurrency.EUR,     // Currency constant
         *           Klarna.BETA,            // Mode, BETA or LIVE
         *           "json",                 // Storage module
         *           "/srv/pclasses.json",   // Storage location
         *           true,                   // SSL
         *           true                    // Candice
         *           );
         * 
         *  k.debug = false;
         */

        /* 
         *  Configure the Klarna object using the config() method (Alternative 3)
         */

        k.config(KlarnaConfig.fromJson("/srv/klarna.json"));

        /*  the file would contain the following data to set the same information as above alternatives:
         * {
         *      "eid":0,
         *      "secret":"sharedSecret",
         *      "country":"DE",
         *      "language":"DE",
         *      "currency":"EUR",
         *      "mode":1,
         *      "ssl":false,
         *      "candice":true,
         *      "pcStorage":"json",
         *      "pcURI":"/srv/pclasses.json"
         *  }
         *
         */
2. Add the article(s), shipping and/or handling fee
        //Here we add a normal product to our goods list.
        k.addArticle(
                4, //Quantity
                "MG200MMS", //Article number
                "Matrox G200 MMS", //Article name/title
                299.99,
                19d, //19% VAT
                0d,
                KlarnaFlags.Goods.INC_VAT.intVal() //Price is including VAT.
                );

        //Next we might want to add a shipment fee for the product
        k.addArticle(
                1,
                "",
                "Shipping fee",
                4.5,
                19d,
                0d,
                KlarnaFlags.Goods.INC_VAT.intVal() + KlarnaFlags.Goods.IS_SHIPMENT.intVal() //Price is including VAT and is shipment fee
                );

        //Lastly, we want to use an invoice/handling fee as well
        k.addArticle(
                1,
                "",
                "Handling fee",
                1.5,
                19d,
                0d,
                KlarnaFlags.Goods.INC_VAT.intVal() + KlarnaFlags.Goods.IS_HANDLING.intVal() //Price is including VAT and is handling/invoice fee
                );
3. Create and set the address(es)
        //Create the address object and specify the values.
        KlarnaAddr addr = new KlarnaAddr(
                "testperson-de@klarna.com",
                "", //We skip the normal land line phone, only one is needed.
                "01522113356",
                "Testperson-de", // First name
                "Approved", // Last Name
                "", //No care of, C/O.
                "Hellersbergstra?e", //For DE and NL specify street number in houseNo.
                "14601",
                "Neuss",
                KlarnaCountry.DE,
                "14", //For DE and NL we need to specify houseNo.
                null //HouseExt Only required for NL.
                );

        //There are also set/get methods to do the same thing, like:
        addr.setEmail("test@example.com");

        //Next we tell the Klarna instance to use the address in the next order.
        k.setAddress(KlarnaFlags.Address.IS_BILLING, addr); //Billing / invoice address
        k.setAddress(KlarnaFlags.Address.IS_SHIPPING, addr); //Shipping / delivery address
4. Specify relevant information from your store (OPTIONAL)
        //Set store specific information so you can e.g. search and associate invoices with order numbers.
        k.setEstoreInfo(
                "175012", //Maybe the estore's order number/id.
                "1999110234", //Could an order number from another system?
                "" //Username, email or identifier for the user?
                );

        //If you don't have the order id available at this stage, you can later use the method updateOrderNo().
5. Set additional information (OPTIONAL)
        /** Comment? **/
        k.setComment("A text string stored in the invoice commentary area.");

    // Session IDs?
    /* We are phasing out the previously used argument session_id.
       you no longer need to implement the checkouthtml on your site but we still require a session_id.
       In the future this argument will be completely removed but for now it needs to be set. */
    k.setSessionID("dev_id_1", "2425967623052370772757633156976982469681");

        /** Shipment type? **/
        //Normal shipment is defaulted, delays the start of invoice expiration/due-date.
        k.setShipmentInfo("delay_adjust", KlarnaFlags.Shipment.EXPRESS_SHIPMENT);

        /* If a company is shopping, reference has to be set. */
        if (addr.isCompany()) {
                k.setReference("Reference Code");
        }
6. Invoke reserveAmount and transmit the data
        try {
                String[] result = k.reserveAmount(
                        "07071960", // Date of birth for DE
                        KlarnaFlags.Gender.MALE, // The customer is male
                        -1, // will calculate the amount using the internal goods list.
                        KlarnaFlags.NO_FLAG, // no specific behaviour like TEST_MODE
                        KlarnaPClass.INVOICE // -1, note that this is an invoice purchase. For part payment purchase you will have a pclass object which you use getId() from.
                        );
                // Check the order status
                KlarnaFlags.OrderStatus res = KlarnaFlags.OrderStatus.get(Integer.parseInt(result[1]));;
                if (res == KlarnaFlags.OrderStatus.PENDING) {
                        /* The order is under manual review and will be accepted or denied at a later stage.
                        Use cronjob with checkOrderStatus() or visit Klarna Online to check to see if the status has changed.
                        You should still show it to the customer as it was accepted, to avoid further attempts to fraud. */
                }
                //Here we get the reservation number
                String rno = result[0];

                //Order is complete, store it in a database.

        } catch (Exception e) {
                // Something went wrong, print the message.
                out.println(e.getMessage());
        }
The code examples have been divided into several steps. Click on the step you would like to see the code example.
1. Initialize and setup the Klarna instance
<%
    Option Explicit
%>




<%
    ' Grab the API object
    ' -Merchant ID or Estore ID, an integer above 0.
    ' -The shared secret which accompanied your eid.
    ' -Country, language and currency.
    Dim kAPI
    Set kAPI = GetKlarna(0, "sharedsecret", "SE", "SV", "SEK")

    ' Do we want to see normal debug information?
    kAPI.DebugInformation = True

    ' Set the address and port to Klarna server.
    ' Use LIVE or BETA depending on which server your eid is associated with.
    kAPI.SetPort(HTTPS_PORT) ' or HTTP_PORT
    kAPI.SetHost(BETA_HOST) ' or LIVE_HOST

    ' Where the XML for the PClasses are stored, e.g. "pclasses.xml"
    kAPI.SetPClassesStorageUri(Server.MapPath("pclasses.xml"))

%>
2. Add the article(s), shipping and/or handling fee
<%

    ' Here we add a normal product to our goods list.
    ' -Quantity
    ' -Article number
    ' -Article name/title
    ' -Price
    ' -VAT, 25% VAT
    ' -Discount
    ' -Flags, price including VAT
    Call kAPI.AddArticle(4, "MG200MMS", "Matrox G200 MMS", 299.99, 25, 0, INC_VAT)

    ' Next we might want to add a shipment fee for the product
    Call kAPI.AddArticle(1, "", "Shipping fee", 40, 25, 0, INC_VAT + IS_SHIPMENT)

    ' Lastly, we want to use an invoice/handling fee as well
    Call kAPI.AddArticle(1, "", "Handling fee", 10, 25, 0, INC_VAT + IS_HANDLING)

%>
3. Create and set the address(es)
<%

    ' Create the address object.
    Dim address
    Set address = new KlarnaAddr

    ' Specify the customers details.
    address.setEmail("always_accepted@klarna.se")
    address.setTelno("") ' We skip the normal land line phone, only one is needed.
    address.setCellno("0765260000")
    address.setFirstName("Testperson-se")
    address.setLastName("Approved")
    address.setCompanyName("") ' No company name
    address.setCareof("") ' No care of, C/O
    address.setStreet("Stårgatan 1") ' For DE and NL specify street number with setHouseNumber.
    address.setHouseNumber("") ' Only required for DE / NL
    address.setHouseExt("") ' Only required for NL.
    address.setZipCode("12345")
    address.setCity("Ankeborg")
    address.setCountry(COUNTRY_SE)

    ' Next we tell the Klarna instance to use the address in the next order.
    Call kAPI.SetAddress(IS_BILLING, address)  ' Billing / invoice address
    Call kAPI.SetAddress(IS_SHIPPING, address) ' Shipping / delivery address

%>
4. Specify relevant information from your store (OPTIONAL)
<%

    ' Set store specific information so you can e.g. search and associate invoices with order numbers.
    ' -Order id 1, maybe the estore's order number/id?
    ' -Order id 2, could be an order number from another system?
    ' -User, Username, email or identifier for the user?
    Call kAPI.SetEstoreInfo("175012", "1999110234", "")

    ' If you don't have the order id available at this stage, you can later use the method updateOrderNo().

%>
5. Set additional information
<%

    ' Comment? (OPTIONAL)
    kAPI.SetComment("A text string stored in the invoice commentary area.")

    ' Shipment type?
    ' Normal shipment is defaulted, delays the start of invoice expiration/due-date.
    Call kAPI.SetShipmentInfo("delay_adjust", EXPRESS_SHIPMENT)

%>
6. Invoke reserveAmount and transmit the data
<%

    On Error Resume Next

    ' Transmit all the specified data, from the steps above, to Klarna.
    ' -pno, Date of birth for DE.
    ' -gender, The customer is a male.
    ' -amount, -1 will calculate the amount using the internal goods list.
    ' -flags, No specific behaviour like RETURN_OCR or TEST_MODE.
    ' -pclass, -1, notes that this is an invoice purchase, for part payment purchase you will have a pclass object on which you use getId().
    ' -encoding, null to automatically use it for DE.
    Dim result
    result = kAPI.ReserveAmount("410321-9202", Null, -1, NO_FLAG, PCLASS_INVOICE, null, true)

    If Err.number = 0 Then
        ' Success

        'Check the order status
        If result(1) = PENDING Then
            ' The order is under manual review and will be accepted or denied at a later stage.
            ' Use cronjob with checkOrderStatus() or visit Klarna Online to check to see if the status has changed.
            ' You should still show it to the customer as it was accepted, to avoid further attempts to fraud.
        End If

        ' Here we get the reservation number
        Dim reservationNumber
        reservationNumber = result(0)

        ' Order is complete, store it in a database.
        Response.Write("Reservation #" & reservationNumber)
    Else
        ' Something went wrong
        Response.Write("Error occured: " & Err.number & " - " & Err.Description & "
" & Err.Source & "
") End If %>

Input data:

Variable Type Description
Required pno/birthdatestringUse the following format:

Sweden: yymmdd-nnnn, it can be sent with or without dash "-" or with or without the two first numbers in the year.
Finland: ddmmyy-nnnn
Denmark: ddmmyynnnn
Norway: ddmmyynnnnn
Germany: ddmmyyyy
Netherlands: ddmmyyyy

d = day, m = month, y = year, n = person specific numbers

If it is a purchase with a company registration number, the reference person can be typed in the first and last name fields. If a social security number/birth date belongs to a person under 18 or if the social security number/birth date is invalid, Klarna will not make a credit report and will instead return an error status.
genderintegerThe customer's gender (0=female, 1=male). Required for purchases in Germany and Netherlands.
Required amountfloat/doubleAmount to be reserved, ex. 9.95(€) or 12O(SEK). This value is to be sent with VAT.
referencestringThe reference person for the purchase if it is a company purchase. You can also use this field to write a message or other important information to the customer on the invoice.
reference_codestringThe reference code for the sale. You can also use this field to write a message or other important information to the customer on the invoice.
orderid1stringOrderid
orderid2stringOrderid
Required delivery_addrarrayDelivery Address created using setAddress function. Please observe that for Sweden the address must be exactly as you receive with getAddresses function.
Required billing_addrarrayInvoicing Address using setAddress function.
Required client_ipstringIP number when the purchase is made online.
Required flagsintegerFlag which affects the invoiced purchase. Input 0 to set no flag.

KRED_TEST_MODE (value: 2) If you set this flag, a test invoice is set despite your store working in live mode. It comes in handy if you wish to test something while avoiding any disturbance to your regular invoicing.

//Klarna Mobile flags
KRED_PHONE_TRANSACTION (value: 512) To tell Klarna that it's a phone transaction
KRED_SEND_PHONE_PIN (value: 1024): To send the customer a PIN code.
Required currencyintegerCurrency code to be used for the invoices.

Swedish krona: KRED_SEK (value: 0)
Norwegian krona: KRED_NOK (value: 1)
Euro: KRED_EUR (value: 2)
Danish krona: KRED_DKK (value: 3)

Please note: Currency, country and language must be the same as where the customer is registered in. E.g. Swedish customer, SEK, Sweden and Swedish.
Required countryintegerCode for the country where your sales will be in:

Sweden: KRED_ISO3166_SE (value: 209)
Finland: KRED_ISO3166_FI (value: 73)
Denmark: KRED_ISO3166_DK (value: 59)
Norway: KRED_ISO3166_NO (value: 164)
Germany: KRED_ISO3166_DE (value: 81)
Netherlands: KRED_ISO3166_NL (value: 154)

Please note: Currency, country and language must be the same as where the customer is registered in. E.g. Swedish customer, SEK, Sweden and Swedish.
Required languageintegerLanguage code for the language used on the invoice.


Swedish: KRED_ISO639_SV (value: 138)
Norwegian: KRED_ISO639_NB (value: 97)
Finnish : KRED_ISO639_FI (value: 37)
Danish: KRED_ISO639_DA (value: 27)
German: KRED_ISO639_DE (value: 28)
Dutch: KRED_ISO639_NL (value: 101)

Please note: Currency, country and language must be the same as where the customer is registered in. E.g. Swedish customer, SEK, Sweden and Swedish.
Required eidintegerAn e-store ID which refers to your store in Klarna's database.
Required secretstringA shared secret which is used to secure all traffic between Klarna and your store.
Required pno_encodingintegerIndicates the country where the person/customer is registered in:

Sweden: value: 2
Norway: value: 3
Finland: value: 4
Denmark: value: 5
Germany: value: 6
Netherlands: value: 7

Please note: Currency, country and language must be the same as where the customer is registered in. E.g. Swedish customer, SEK, Sweden and Swedish.
Required pclassintegerThis argument designates campaign code to be used at the purchase and is utilized when the sale is a part payment or a special campaign purchase. If the sale is an invoice purchase this argument shall be set to -1.

-1 = invoice
xxx = campaign
xxx = all other pclasses*

Please note that part payment and special campaign purchases are not available for companies.

*There are two ways to retrieve pclasses.

1. Go to Klarna Online and press "view store" button in the menu on the left. In the store view, click "Click here to view campaigns".

2. Use the function fetchPClasses to save all pclass values to your database.
Required goodsListarrayA list of goods. Every listed item is created using the addArticle function.
commentstringA text string stored in the invoice commentary area.
Required shipmentinfoarray [delay_adjust] Required
  • (int) - The two values determine how long after invoice activation Klarna starts countdown to the expiration date. Both countdowns are by default zero days. The time of the countdowns can be negotiated with Klarna.

    KRED_NORMAL_SHIPMENT (value: 1) KRED_EXPRESS_SHIPMENT (value: 2).

travel_infoarray Not used at this moment
income_expensearray [yearly_salary]
  • (int) - Customer's yearly salary. Used for part payment in Denmark only.

bank_infoarray Not used at this moment
session_idarray [dev_id_1]
  • (string) -

[dev_id_2]
  • (string) -

[dev_id_3]
  • (string) -

[beh_id_1]
  • (string) -

[beh_id_2]

[beh_id_3]
  • (string) -
extra_infoarray [cust_no]
  • (string) - The customer number in the estores system

[bclass]
  • (int) - This value is set per store when needed. Consult your integration technician if you will use this value.

[pin]
  • (string) - If you are using Klarna Mobil you send the customers pin code here. Otherwise you only use an empty string.