API - Overview

API - Files, fonts and currencies

Retrieve public and protected files, the font list and available currencies.

Endpoint overview

MethodEndpointDescriptionAccess
GET/public-api/v1/file/public/products/:productId/:sizeReturns a public product preview. Size must be small.png, medium.png or big.png.public
GET/public-api/v1/file/protected/:keyReturns a protected file by storage key.signed URL or files:read
GET/public-api/v1/fontsReturns all available fonts.public
GET/public-api/v1/currenciesReturns all currencies.public

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.

EndpointAccessDetails
/file/public/products/:productId/small.pngpublicSmall product preview.
/file/public/products/:productId/medium.pngpublicMedium product preview.
/file/public/products/:productId/big.pngpublicLarge product preview.
/file/protected/:keysigned URL or files:readProtected object storage file.
/fontspublicArray of font records.
/currenciespublicArray 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
  }
]