Authentication
To authenticate with Klarna you use your API Credentials and HTTP Basic auth.
The credentials consist of two elements:
Username - Consists of your Merchant ID (MID) - a unique number that identifies your e-store, combined with a random string.
Password - a string which is associated with your Merchant ID and is used to authorize use of Klarna's APIs
Note: The API credentials are separate from your Merchant ID, and it is possible to have several API credentials associated with the same Merchant ID.
The credentials should be sent as an authorization header for every request with the username and password.
You receive both your live and test credentials by contacting Klarna sales for your country.
If the credentials are missing or wrong Klarna will respond with 401 Unauthorized
. You can read more about HTTP Basic auth in the Wikipedia article.