POST/api/v1/pdf-template-config/preview

Preview PDF Template

Generates an HTML preview of a PDF template using sample invoice data. Use this to preview how a template will look with specific colors and fonts before saving the configuration.

POST /api/v1/pdf-template-config/preview

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token or API key for authentication
X-CompanystringYesCompany UUID to scope the request
Content-TypestringYesMust be application/json

Request Body

FieldTypeRequiredDescription
templateSlugstringNoTemplate to preview (default: classic)
primaryColorstringNoPrimary color to preview in hex format
fontFamilystringNoFont family to preview

Request

cURL
curl -X POST https://api.storno.ro/api/v1/pdf-template-config/preview \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Company: 550e8400-e29b-41d4-a716-446655440000" \
  -H "Content-Type: application/json" \
  -d '{
    "templateSlug": "modern",
    "primaryColor": "#6366f1"
  }'

Response

Returns the rendered HTML preview.

Headers:

HeaderValue
Content-Typetext/html; charset=UTF-8

The response body contains the full HTML document that can be rendered in a browser or converted to PDF.

Error Codes

CodeDescription
401Missing or invalid authentication token
404Company not found
500Preview generation failed