API Keys
API keys are used to authenticate requests to the Straumur API. You can create, view, and manage your API keys directly in the Merchant Portal.
Getting Test API Keys
To develop against Straumur's Test environment, request access by sending an email to developers@straumur.is.
Managing API Keys in the Merchant Portal
- Log in to the Merchant Portal.
- Navigate to API Keys in the menu.
Creating a New API Key
- Click Generate New Key.
- Enter a descriptive name for the key (e.g., "Production Website" or "Mobile App").
- Click Create.
- Important: Copy and securely store the key. For security reasons, the full key is only available to copy for 24 hours after creation.
Store your API keys securely. Never expose them in client-side code, public repositories, or logs.
Viewing Existing Keys
The API Keys page displays all your existing keys with the following information:
- Key name: The descriptive name you assigned to the key.
- Api key: Last four letters of the API key. Copy button active if less than 24h from creation of the key.
- Status: Whether the key is active or revoked.
- Date Created: When the key was created.
For security purposes, only a partial view of the key is shown, and after 24 hours the key cannot be copied. If you've lost a key, you'll need to create a new one.
Disabling an API Key
If an API key is compromised or no longer needed, you should disable it:
- Find the key in the API Keys list.
- Click the Disable button.
- Confirm the action.
Disabling a key is immediate and permanent. Any applications using that key will immediately lose access to the API.
Contracts and Terminals
Each API key is linked to one or more contracts. A contract determines which e-commerce solutions (terminals) the key can access:
| Solution | Description |
|---|---|
| Hosted Checkout | Straumur-hosted payment page integration |
| Payment Gateway | Direct API integration for custom checkout |
| Payment Links | Create and share payment links |
| Tokenize Links | Create links for card tokenization |
| Shopify | Shopify store integration |
| WooCommerce | WooCommerce store integration |
The available solutions depend on your contract configuration. To enable additional solutions, contact Straumur.
Using Your API Key
Include your API key in the header of all API requests:
- X-API-Key:
your-api-key-here
Example:
curl -X GET "https://api.straumur.is/v1/payments" \
-H "X-API-Key: e684c4be6b2b2318c0433b185b7e34ac2bfe941fcf4370ca9d"