Authentication
The Merchant API and the Partner API use HTTP Basic authentication. Every request carries an Authorization header with your API username and API key.
These credentials are not the API key you use for the Checkout API, and not your portal password. They belong to a dedicated API user.
Get credentials
Email straumur@straumur.is to request access to the reporting APIs. Tell us:
- whether you are a merchant or a partner,
- whether you need test, live or both,
- the email address we should notify.
We create an API user and send you an email with a link to the Merchant Portal. The email does not contain the username or the API key. Sign in to the Merchant Portal as an administrator to view them.
Test and live credentials are issued separately. Test credentials are rejected on live, and the reverse.
The API key gives read access to all of your settlement and transaction data, and for a partner, to the data of every merchant linked to you. Store it in a secret store, never in source code or in a browser or mobile app. Call the API from your server only.
Send the header
Join the username and API key with a colon, Base64-encode the result, and send it after Basic :
GET /api/Agreements HTTP/1.1
Host: partner-api.staging.straumur.is
Authorization: Basic bXktYXBpLXVzZXI6WU9VUl9BUElfS0VZ
Most HTTP clients build the header for you:
curl -u "my-api-user:YOUR_API_KEY" \
"https://partner-api.staging.straumur.is/api/Agreements"
var credentials = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{username}:{apiKey}"));
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", credentials);
Failed authentication
A missing header, an unknown username or a wrong API key returns 401 Unauthorized with an empty body and the header WWW-Authenticate: Basic realm="straumur.is". The same happens if the API user has been deactivated.
What you can see
- Merchant API: every agreement of the merchant the API user belongs to, and the terminals, transactions, batches, settlements and payments on those agreements.
- Partner API: every agreement linked to any of your partner contracts, across all of your merchants. Filter by
AgreementNumberto work on one merchant at a time.
You never see data outside that scope. A lookup by ID for a record that belongs to someone else behaves as if the record does not exist.