Explore Klarna's approach to ensuring consistency in data representation. Our guide covers standards for currencies, amounts, dates, and more, tailored for seamless integration.
We maintain a consistent format for currencies, amounts, and dates across all Klarna APIs.
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.
An open enum is an enumeration type that allows for values beyond the explicitly defined, named options. This contrasts with a traditional "closed" enum, where a variable is strictly limited to one of the predefined values. Open enums are designed to handle future changes without requiring immediate updates to all systems that use them.
This means integrations must expect more values to be added to the enum over time. Such changes are categorized as non-breaking changes.
Open enums are always in lower_snake_case unless otherwise stated.
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 fractional seconds 98 (98 milliseconds) and the UTC timezone.
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.
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.