Skip to content

API Keys

API keys provide server-to-server authentication for the Islamic Open Finance™ API.

TypePrefixUsage
Secret Keyiof_sk_Server-side only
Publishable Keyiof_pk_Client-side (limited access)
Test Keyiof_sk_test_Sandbox environment
  1. Navigate to SettingsAPI Keys
  2. Click Create New Key
  3. Select permissions and scopes
  4. Copy and securely store the key
const apiKey = await iof.apiKeys.create({
name: "Production Server",
permissions: ["contracts:read", "contracts:write"],
expiresAt: new Date("2025-12-31"),
});
console.log(apiKey.secretKey); // iof_sk_live_...

Include the key in the Authorization header:

Terminal window
curl https://api.islamicopenfinance.com/api/v1/contracts \
-H "Authorization: Bearer iof_sk_live_abc123..."

Or with the SDK:

import { IslamicOpenFinance } from "@iof/sdk";
const iof = new IslamicOpenFinance({
apiKey: process.env.IOF_API_KEY,
});
ScopeDescription
contracts:readRead contract data
contracts:writeCreate/update contracts
kyc:readRead KYC data
kyc:writeSubmit KYC verifications
billing:readView billing information
admin:*Full administrative access
  • Keys are only shown once at creation
  • Rotate keys regularly (recommended: every 90 days)
  • Use different keys for different environments
  • Monitor key usage in the dashboard

For session-based authentication, Islamic Open Finance™ supports JWT (JSON Web Tokens).

Header.Payload.Signature
Terminal window
curl -X POST https://api.islamicopenfinance.com/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"apiKey": "iof_sk_live_abc123...",
"scope": ["contracts:read", "contracts:write"]
}'

Response:

{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"tokenType": "Bearer",
"expiresIn": 3600,
"refreshToken": "iof_rt_..."
}
Terminal window
curl https://api.islamicopenfinance.com/api/v1/contracts \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  • Store tokens securely (never in localStorage for sensitive apps)
  • Implement token refresh before expiry
  • Use short-lived access tokens (1 hour recommended)
  • Validate token claims on the server