Skip to content

Authentication

Storelayer uses two authentication methods depending on the context:

Use API keys for server-to-server communication. API keys are passed via the Authorization header.

Terminal window
curl -X GET https://api.storelayer.io/v1/customers \
-H "Authorization: Bearer YOUR_API_KEY"
TypePrefixUsage
Livesk_live_Production API calls
Testsk_test_Development and testing
  1. Go to your project Settings → API Keys
  2. Click Create API Key
  3. Give it a descriptive name
  4. Copy the key — it won’t be shown again

Use JWT tokens for user-facing applications. JWTs are issued after a user authenticates through the dashboard.

  • Access tokens expire after 1 hour
  • Refresh tokens expire after 7 days
  • Use the refresh token to obtain new access tokens

For the event ingestion endpoint (/ingest/*), use API key authentication with the X-API-Key header:

Terminal window
curl -X POST https://api.storelayer.io/ingest/events \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"event": "purchase", "customerId": "cust_123", "amount": 4999}'
PlanRequests/minBurst
Free6010
Pro600100
EnterpriseCustomCustom