reserve_amount (required)

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 activate_reservation, i.e. you can't activate through Klarna Online.

Example PHP code reserve_amount($pno, $amount, $reference, $reference_code, $orderid1, $orderid2, $lev_addr, $f_addr, $email, $phone, $cell, $client_ip, $flags, $currency, $country, $language, $eid, $secret, $pno_encoding, $pclass, $ysalary, $goodsList, &$result) Input Data:

Required Variable Type Description
required pno string Social security number/company registration number or birth date and gender in Germany. 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. Use the following format:
  • (SE) yymmdd-nnnn, it can be sent with or without dash "-" or with or without the two first numbers in the year.
  • (FI) ddmmyy-nnnn, it can be sent with or without dash "-".
  • (DK) ddmmyynnnn
  • (NO) ddmmyynnnnn
  • (DE) ddmmyyyyg
  • (NL) ddmmyyyyg
    d = day, m = month, y = year, n = person specific numbers, g = gender (0=female, 1=male)
required amount integer Amount to be reserved in ören or cents. This value is to be sent with tax.
required when selling to companies reference string The reference person for the purchase. You can also use this field to write a message or other important information to the customer on the invoice.
reference_code string The 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.
orderid1 string Orderid, optional
orderid2 string Orderid, optional
Required lev_addr array Delivery Address created using mk_address function. Please observe that for Sweden the address must be exactly as you receive with get_addresses function.
Required f_addr array Invoicing Address using mk_address function.
required email string E-mail
phone string Telephone number
required cell string Mobile number
required client_ip string IP number when the purchase is made online, otherwise “0.0.0.0” (used to avoid fraud).
Required flags integer Flag which affects the invoiced purchase. Input 0 to set no flag.
$KRED_TEST_MODE (flag 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.
$KRED_SEND_BY_MAIL (flag 4): To send the invoice by mail
$KRED_SEND_BY_EMAIL (flag 8): To send the invoice by e-mail
$KRED_DELAYED_PAY (flag 16): To make a part activation of a reservation. You can use the same reservation number for the following activations.
$KRED_PHONE_TRANSACTION (flag 512): To tell Klarna that its a phone transaction
$KRED_SEND_PHONE_PIN (flag 1024): To send the customer a PIN code.
required currency integer Currency code to be used for the invoices.
  • $KRED_SEK for Swedish krona
  • $KRED_NOK for Norwegian krona
  • $KRED_EUR for Euro
  • $KRED_DKK for Danish krona.
Please note: you can only use the currency of the country your sales will be in, e.g. SEK for Sweden.
Required country integer Code for the country where your sales will be in
  • $KRED_ISO3166_SE for Sweden
  • $KRED_ISO3166_NO for Norway
  • $KRED_ISO3166_FI for Finland
  • $KRED_ISO3166_DK for Denmark
  • $KRED_ISO3166_DE for Germany
  • $KRED_ISO3166_NL for Netherlands
Required language integer Language code for the language used on the invoice.
  • $KRED_ISO639_SV for Swedish
  • $KRED_ISO639_NB for Norwegian
  • $KRED_ISO639_FI for finnish
  • $KRED_ISO639_DA for Danish
  • $KRED_ISO639_DE for German
  • $KRED_ISO639_NL for Dutch
Please note: You cannot decide the language, it is decided by in which country your sales will be in.
Required eid integer A store ID which refers to your store in Klarna's database.
Required secret string A shared secret which is used to secure all traffic between Klarna and your store.
Required pno_encoding integer Indicates the country where the person/customer is registered in
  • Sweden = 2
  • Norway = 3
  • Finland = 4
  • Denmark = 5
  • Germany = 6
  • Netherlands = 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 pclass integer This argument designates campaign code to be used at the purchase and is utilized when the sale is a part payment purchase. If the sale is an invoice purchase this argument shall be set to -1. Please note that part payment purchases are not available for companies.
Required for DK ysalary integer States the persons annual income in ören or cents. This argument must be given for part payment purchases in Denmark. Otherwise this argument shall be set to 0.
Required goodsList array A list of goods. Every listed item is created using the mk_goods or mk_goods_flags function. We recommend to use the mk_goods_flags function over mk_goods.


Return value
A reservation number or error message

Errors

Error Description
pno The social security number does not exist.
amount This person has exceeded his/her credit limit at Klarna or is not allowed to buy at all.
estore_blacklisted This estore id is blacklisted in Klarna's database.
invalid_estore_secret The shared secret does not match the estore id.
address The address or name does not match the one in the national register. Make sure the address is correct and in Sweden try to use the get_addresses method to avoid this.
customer_not_18, under_aged This customer is under 18 years old.
dead The customer has, according to the given Social Security Number, died.
estore_overrun The amount of the invoice exceeds the maximum invoice amount allowed under your contract with Klarna.
unknown_estore The store cannot be found in Klarna's database.
sum_low_for_pclass The total amount of the part payment purchase is too low.
cellno The cellno variable is not a valid cellphone number
email The e-mail variable is not a valid e-mail address.
client_ip The ip value is not valid, make sure you send the customers ip number.
 

API functions

Add_transaction functions
Invoice handling functions
Test persons