Last updated today

Data types

We maintain a consistent format for currencies, amounts, and dates across all Klarna APIs.

CURRENCY

We use the ISO 4217 standard for defining currencies. Examples are USDGBPEUR or SEK.

{
  "purchase_currency": "USD"
}
Copy

AMOUNT

We express amounts in minor units according to the ISO 4217 standard. That means they are expressed in the smallest unit of currency. Examples are USD with 1000 representing $10, GBP with 500 representing £5, EUR with 50 representing €0.50 and SEK with 100 representing 1kr.

{
  "order_amount": 1000
}
Copy

STRINGS

Strings may be up to 255 characters, unless otherwise noted in the field description.

String properties used for input MAY be validated to conform to the following Unicode block groups. More details noted on API operations.

Control characters (U+0000..U+001F and U+007F) are always excluded from allowed input. Punctuations included in the allowed unicode blocks are permitted.

  • Latin Scripts
    • Basic Latin U+0000..U+007F (excluding control characters U+0000..U+001F and U+007F)
    • Latin-1 Supplement U+0080..U+00FF
    • Latin Extended-A U+0100..U+017F
    • Latin Extended-B U+0180..U+024F
  • Greek Scripts
    • Greek and Coptic U+0370..U+03FF
    • Greek Extended U+1F00..U+1FFF
  • Phonetic Extensions
    • Phonetic Extensions U+1D00..U+1D7F
    • Phonetic Extensions Supplement U+1D80..U+1DBF
  • Symbols and Emoticons U+1F600..U+1F64F

DATES

Dates are expressed according to the ISO 8601 standard with combined date, time and timezone. The exception to this are date_of_birth fields where we accept values in the YYYY-MM-DD format.

Examples

  • 2015-08-10T07:45:00Z representing the 10th of August 2015 at 07:45:00 and the UTC timezone.

  • 2015-08-10T07:45:00.098Z representing the 10th of August 2015 at 07:45:00, with factional seconds 98 (98 milliseconds) and the UTC timezone.

LOCALE & COUNTRY

Locales should be formatted as a language tag consisting of a two-letter language code combined with a two-letter country code according to RFC 5646. Examples are en-us for US English, en-gb for British English and sv-se for Swedish (in Sweden).

Countries are handled as two-letter country codes according to ISO 3166 alpha-2. Examples are us for the United States, gb for Great Britain and se for Sweden.

{
  "locale": "en-us",
  "purchase_country": "us"
}
Copy

ENCODING

We expect all data that is sent to Klarna's APIs to be UTF-8 encoded.

IDENTIFIERS

Only identifiers generated by Klarna will be exposed through properties suffixed with _id. Identifiers generated by partners will be accepted through properties suffixed with _reference.

Next to Security