REST API reference

Two APIs live side by side: addon routes under veyop/v1, and the portable api/v1/* API that powers the core admin single-page app.

Addon routes (veyop/v1)

Register routes with $addon->route($method, $path, $handler, $access). On WordPress they appear under the veyop/v1 REST namespace. On OpenCart, PrestaShop, and Shopware the host's route registry serves them. The browser reaches them through Veyop.http.request(path) on every platform.

<?php
// plugins/my-addon/inc/api-endpoints.php

function my_addon_register_routes(VeyopAddon $addon): void {
    // Admin only (the default)
    $addon->route('GET', 'my-addon/settings', static fn(): array => my_addon_get_settings());

    // Anyone, including guests
    $addon->route('POST', 'my-addon/quote', 'my_addon_quote', 'public');
}

The handler receives one flat request array (query and body, plus _files) and returns JSON-serialisable data. Throw to send an error. $access is admin (default), customer, or public.

Routes that only need WordPress can use rest_api_init and register_rest_route(), as some bundled addons do. That hook does not run on other platforms.

Example addon routes

AddonRoutePurpose
Dynamic PricingGET/POST /veyop/v1/pricing/rulesList / create pricing rules.
Dynamic PricingPOST /veyop/v1/pricing/rules/deleteDelete a pricing rule.
Dynamic PricingPOST /veyop/v1/pricing/simulateTest rules from the admin simulator.
Dynamic PricingPOST /veyop/v1/pricing/quoteEvaluate all applicable rules and return a price quote for a design.
Templates & Smart LayoutsGET/POST /veyop/v1/design-templatesList / create design templates.
Templates & Smart LayoutsGET /veyop/v1/design-templates/{id}Fetch a single template.
Templates & Smart LayoutsGET /veyop/v1/design-templates/designer-configConfig payload the designer panel uses to list available templates.
Templates & Smart LayoutsGET /veyop/v1/design-templates/quick-configQuick Personalization config for a given woo_product_id — drives the shop-grid panel.
Templates & Smart LayoutsGET/DELETE /veyop/v1/design-templates/assignmentRead or remove a template's assignment to a Woo product.
Templates & Smart LayoutsPOST /veyop/v1/design-templates/assignment/mockupSave a captured product mockup image for an assignment.
Templates & Smart LayoutsPOST /veyop/v1/design-templates/{id}/assignAssign a template to a Woo product (powers the Change Product flow).
Smart ConfiguratorGET /veyop/v1/smart-configurator/{product_id}Fetch the option-to-layer mapping configuration for a product.
Smart ConfiguratorPOST /veyop/v1/smart-configurator/applyApply a selected option's mapped layer changes to a design.
Print QueueGET /veyop/v1/print-queueList print queue jobs, filterable by state.
Print QueueGET/POST /veyop/v1/print-queue/settingsRead / update hotfolder configuration.
Print QueuePOST /veyop/v1/print-queue/{id}/retry · /processRetry or manually process a job.
Print QueueGET /veyop/v1/print-queue/{id}/download/{type}Download a job's artifact, ticket, or barcode (type = artifact | ticket | barcode).
Print QueuePOST /veyop/v1/print-queue/bulk-downloadBulk-download completed jobs as a ZIP.

Portable admin API (api/v1/*)

The core admin single-page app is powered by a lighter, portable API — not the WordPress REST API — so the same admin UI runs on WordPress, OpenCart, PrestaShop, and Shopware. These endpoints sit behind the platform services abstraction rather than register_rest_route().

ResourceCovers
fontsEnabled Google Fonts and uploaded custom fonts.
colorsThe global color palette for text and cliparts.
cliparts, categoriesClipart library and its categories.
text_style_cardsReusable text style presets.
settingsGeneral settings — custom CSS, sharing toggles, upload limits.
customer_designsSaved customer designs, for the admin design library.
addonsGET /api/v1/addons (list + state), POST /api/v1/addons/state (enable/disable), POST /api/v1/addons/upload (install a ZIP).
licenseLicense key activation and status.
dashboardAdmin dashboard summary data.
icc_profilesCMYK / print color profile management.
mediaMedia upload handling used across the admin.
printing, productsPrinting method and product configuration data.
csrfRefreshes the CSRF token for a long-lived admin tab.
layoutDesigner layout settings.

Request rules

  • Method: only actions listed as read actions answer GET or HEAD. Any other action answers 405.
  • Authentication: a request without the required admin capability answers 401. The license and addons resources can never be made public.
  • CSRF: a state-changing request needs a valid token in X-CSRF-Token, or it answers 403.
  • Rate limit: state-changing requests are limited per IP to 60 per minute for each resource (120 for clipart saves), then answer 429 with Retry-After.

Both APIs sit behind the same platform services facade (settings, database, routes, auth, etc. — see the requiresServices manifest field), so addons requesting the same services get consistent behavior whichever API style they use.

Auth: admin routes require an authenticated admin session plus a CSRF nonce on state-changing requests; customer-facing and public routes re-validate everything server-side — never trust a price or design payload sent from the browser. pricing/quote is public on purpose: it prices the submitted design with the shop's own rules and stores nothing.

Addon package endpoints

EndpointContract
GET /api/v1/addonsInstalled version, source/trust metadata, latest official version, update availability, and update_delivery: my_orders.
POST /api/v1/addons/uploadMultipart file; optional license_key, allow_unsigned_custom=1. Restore adds replace_custom=1 and expected_slug.
POST /api/v1/addons/stateJSON active: explicit array of active addon directories. Dependencies of every listed addon are added, and folders that are not installed are dropped. New uploads are not auto-activated.

Official restore requires a trusted signed ZIP whose verified slug matches expected_slug. Paid Veyo slugs require their addon key (or an earlier Veyo Pro key). Third-party/free custom slugs do not require a Polar license.