Skip to main content

API Key Authentication

All requests require an API key passed in the X-API-Key header:
Newer credentials can use sk_test_, pk_test_, sk_live_, or pk_live_. Some legacy Modulus APIs use the shorter sk_ or pk_ prefixes. Always send the complete key exactly as issued. Permissions determine access independently of the prefix. Keep any key that can read transaction data out of client-side code, public repositories, and browser requests.
Requests without a valid API key receive a 401 Unauthorized response.

Entity Scoping

Every API key is associated with an entity level in the hierarchy: Partner, Merchant, or Branch. Data access is automatically restricted based on your key’s level.
Entity scoping is applied automatically - you don’t need to add any special filters. A merchant-level key will never see another merchant’s data, even if you try to filter by their merchant_id.

Error Responses

401 Unauthorized

Returned when the API key is missing, invalid, or expired:

503 Service Unavailable

Returned when the service is temporarily unavailable. This is not an invalid-credential response; retry with backoff and keep the same key.

Security Best Practices

Never include API keys in frontend code, mobile apps, or public repositories. Make API calls from your backend server.
Store API keys in environment variables, not in source code:
Contact support@moduluslabs.io to rotate your API key if you suspect it has been compromised.
Request a merchant-level or branch-level key if you don’t need partner-wide access. Least privilege reduces the impact of key exposure.

What’s Next?

Quickstart

Make your first API call

Filtering & Sorting

Learn all available query parameters