All requests to the Scale API are authenticated using API keys. Scale uses a dual-key security model to protect your store’s resources while allowing browser-side client requests.
Key Types
When you go to your store’s developer dashboard, you can generate two types of API keys depending on where they will be used:
Never expose your Secret Key (sk_) in client-side code (like browsers or mobile apps). Anyone who extracts it can modify your catalog, download order history, and access customer details.
Validation Errors (400 Bad Request)
When your requests fail input validation checks (e.g., missing required fields, invalid UUID formats, or database integrity checks like a non-existent shop), the API returns a 400 Bad Request status code.
The response body contains an array of validationErrors matching the fields verified by the internal Zod validation schemas.
Response Body (400 Bad Request)
How to Authenticate
To authenticate your API requests, pass your API key in either of the following headers:
This is the cleanest way to pass the API key, especially for custom frontends.
Standard Bearer token format is also supported:
Sample Request
Here is an example of fetching products using a Publishable Key in a request across different programming languages:
cURL
JavaScript
Axios
PHP
Python