Authentication
Elective Commerce uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
This site allows you to test endpoints live.
Paste your public key in the top header, and ensure https://docs.electivecommerce.com is added to your allowed origins in the Dashboard.
Base URL
https://api.electivecommerce.com/v11 Key Types
pk_live_...Safe for client-side code (browsers, mobile apps). Read-only access to published products and collections.
sk_live_...Server-side only. Full read/write access. Never expose this key in frontend code.
2 Usage
Authenticate your API calls by including your key in the Authorization header of every request.
3 Allowed Origins (CORS)
Important
Public API keys are protected by strict CORS policies. You must whitelist your domain (e.g. https://www.mystore.com) in the Dashboard > Settings page.
Requests from unauthorized domains will be rejected with 403 Forbidden.
4 Example
fetch('https://api.electivecommerce.com/v1/products', {
method: 'GET',
headers: {
'Authorization': 'Bearer pk_live_12345...',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data));