Quick Start
Prerequisites
Section titled “Prerequisites”- A Storelayer account at app.storelayer.io
- An API key from your project settings
-
Create a project
After signing in, create a new project from the dashboard. Each project is an isolated environment with its own customers, wallets, and promotions.
-
Get your API key
Navigate to Settings → API Keys in your project dashboard and create a new API key. You’ll need this for all API requests.
-
Make your first API call
Terminal window curl -X GET https://api.storelayer.io/v1/customers \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json"const response = await fetch('https://api.storelayer.io/v1/customers', {headers: {'Authorization': 'Bearer YOUR_API_KEY','Content-Type': 'application/json',},})const data = await response.json()console.log(data) -
Create a customer
Terminal window curl -X POST https://api.storelayer.io/v1/customers \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"email": "customer@example.com","name": "Jane Doe","metadata": {"source": "website"}}' -
Credit points to a customer’s wallet
Terminal window curl -X POST https://api.storelayer.io/v1/wallets/{customerId}/credit \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"amount": 500,"reason": "Welcome bonus"}'
Response Format
Section titled “Response Format”All API responses follow a consistent format:
// Success{ "success": true, "data": { ... }}
// Error{ "success": false, "error": { "code": 400, "message": "Validation error: email is required" }}Next Steps
Section titled “Next Steps”- Authentication — Learn about API keys and JWT tokens
- Core Concepts — Understand the Storelayer data model
- API Reference — Full API documentation