To create API credentials for WHMCS, login into your Klarna Account and open the page "Settings" → "Klarna API Credentials".

On the API credentials page click the button "Generate new Klarna API credentials" and insert the username and password at the WHMCS gateway configuration page.