Skip to main content

Authentication

All API requests to LuxCore must be authenticated. Most integrations use API keys on API v1. Merchants explicitly onboarded to API v2 use HMAC signatures for payment and balance requests.

Obtaining API Keys

API keys and merchant accounts are created by the LuxCore team during onboarding. Self-registration is not available.
To obtain your API keys:
  1. Contact your LuxCore account manager
  2. Or email developers@lux-core.io
Once your account is set up, you can view your API keys in the Merchant Dashboard under Settings → API Keys.

API Key Types

LuxCore uses API keys to authenticate requests.

Key Types

Keep your API keys secure! Never expose them in client-side code, public repositories, or browser requests.

Making API v1 Authenticated Requests

Include your API key in the X-API-Key header with every request:

API v2 HMAC Requests

Merchants onboarded to API v2 use HMAC-authenticated endpoints:
API v2 does not accept X-API-Key. Each request must be signed with HMAC-SHA256 using the payment HMAC secret issued during onboarding or API v2 enablement. This secret is separate from webhook signing secrets.

Required Headers

Canonical String

Build the canonical string exactly as:
Rules:
  • method is uppercase, for example POST or GET
  • path_with_query includes the API v2 path and any query string exactly as sent
  • sha256_raw_body_hex is the SHA-256 hash of the raw request body bytes
  • GET requests use an empty raw body hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  • Reject locally if the timestamp differs from current time by more than 300 seconds
  • Never reuse a nonce within the 300-second replay window
Examples:

Node.js Example

JWT Bearer Token

Some endpoints also support JWT Bearer token authentication as an alternative to API keys.
For API v1 merchant integrations, API keys are the recommended authentication method. API v2 payment creation uses HMAC. JWT Bearer tokens are available for advanced use cases — contact support for details.

Test Mode vs Production

Test and production requests use the same API endpoint. The environment is determined by your API key type.

Test Mode Behavior

When using test API keys (qp_test_sk_*):
  • Payments are simulated and do not process real funds
  • Webhooks are delivered normally for testing integrations
  • All API responses mirror production behavior
  • Balance operations use test balances isolated from production
  • No actual bank transfers or card charges occur

Switching Environments

Simply change your API key to switch between test and production:

API Key Scopes

API keys can be configured with specific scopes to limit access:

Rate Limits

API requests are rate-limited to ensure fair usage:
Rate limits are applied per API key. If you exceed the limit, you’ll receive a 429 Too Many Requests response.

Error Responses

Authentication errors return standard HTTP status codes:
Example Error Response

Best Practices

Use Environment Variables

Store API keys in environment variables, never in code

Rotate Keys Regularly

Regenerate API keys periodically for security

Use Minimal Scopes

Request only the scopes your application needs

Monitor Usage

Track API usage in the dashboard for anomalies

Key Rotation

To rotate your API keys:
  1. Generate a new API key in the Dashboard under Settings -> API Keys
  2. Update your application to use the new key
  3. Verify the new key works correctly
  4. Deactivate the old key in the Dashboard
Multiple API keys can be active simultaneously, allowing zero-downtime rotation. For webhook secret rotation, delete and recreate the webhook endpoint with a new secret.