Files, fonts and currencies
Public preview files are browser-friendly. Protected files require a signed URL or an API credential with files:read. Fonts and currencies are public read endpoints.
| Endpoint | Access | Details |
|---|---|---|
/file/public/products/:productId/small.png | public | Small product preview. |
/file/public/products/:productId/medium.png | public | Medium product preview. |
/file/public/products/:productId/big.png | public | Large product preview. |
/file/protected/:key | signed URL or files:read | Protected object storage file. |
/fonts | public | Array of font records. |
/currencies | public | Array of currency records. |
Example request (fetch)
const publicPreview = await fetch(
'https://alterproduct.com/public-api/v1/file/public/products/4/medium.png'
);
const protectedFile = await fetch(
'https://alterproduct.com/public-api/v1/file/protected/user_34/381/design/mockup-large.webp',
{
headers: authHeaders
}
);
const fonts = await fetch('https://alterproduct.com/public-api/v1/fonts').then((res) => res.json());
const currencies = await fetch('https://alterproduct.com/public-api/v1/currencies').then((res) => res.json());Example response
[
{
"id": 1,
"family": "Inter",
"source": "google",
"category": "sans-serif",
"variants": ["regular", "600", "700"],
"subsets": ["latin"],
"version": "v19",
"menu": "Inter",
"files": {
"regular": "https://..."
}
}
][
{
"id": 1,
"code": "EUR",
"name": "Euro",
"symbol": "€",
"decimalPlaces": 2
}
]