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
| Addon | Route | Purpose |
|---|---|---|
| Dynamic Pricing | GET/POST /veyop/v1/pricing/rules | List / create pricing rules. |
| Dynamic Pricing | POST /veyop/v1/pricing/rules/delete | Delete a pricing rule. |
| Dynamic Pricing | POST /veyop/v1/pricing/simulate | Test rules from the admin simulator. |
| Dynamic Pricing | POST /veyop/v1/pricing/quote | Evaluate all applicable rules and return a price quote for a design. |
| Templates & Smart Layouts | GET/POST /veyop/v1/design-templates | List / create design templates. |
| Templates & Smart Layouts | GET /veyop/v1/design-templates/{id} | Fetch a single template. |
| Templates & Smart Layouts | GET /veyop/v1/design-templates/designer-config | Config payload the designer panel uses to list available templates. |
| Templates & Smart Layouts | GET /veyop/v1/design-templates/quick-config | Quick Personalization config for a given woo_product_id — drives the shop-grid panel. |
| Templates & Smart Layouts | GET/DELETE /veyop/v1/design-templates/assignment | Read or remove a template's assignment to a Woo product. |
| Templates & Smart Layouts | POST /veyop/v1/design-templates/assignment/mockup | Save a captured product mockup image for an assignment. |
| Templates & Smart Layouts | POST /veyop/v1/design-templates/{id}/assign | Assign a template to a Woo product (powers the Change Product flow). |
| Smart Configurator | GET /veyop/v1/smart-configurator/{product_id} | Fetch the option-to-layer mapping configuration for a product. |
| Smart Configurator | POST /veyop/v1/smart-configurator/apply | Apply a selected option's mapped layer changes to a design. |
| Print Queue | GET /veyop/v1/print-queue | List print queue jobs, filterable by state. |
| Print Queue | GET/POST /veyop/v1/print-queue/settings | Read / update hotfolder configuration. |
| Print Queue | POST /veyop/v1/print-queue/{id}/retry · /process | Retry or manually process a job. |
| Print Queue | GET /veyop/v1/print-queue/{id}/download/{type} | Download a job's artifact, ticket, or barcode (type = artifact | ticket | barcode). |
| Print Queue | POST /veyop/v1/print-queue/bulk-download | Bulk-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().
| Resource | Covers |
|---|---|
fonts | Enabled Google Fonts and uploaded custom fonts. |
colors | The global color palette for text and cliparts. |
cliparts, categories | Clipart library and its categories. |
text_style_cards | Reusable text style presets. |
settings | General settings — custom CSS, sharing toggles, upload limits. |
customer_designs | Saved customer designs, for the admin design library. |
addons | GET /api/v1/addons (list + state), POST /api/v1/addons/state (enable/disable), POST /api/v1/addons/upload (install a ZIP). |
license | License key activation and status. |
dashboard | Admin dashboard summary data. |
icc_profiles | CMYK / print color profile management. |
media | Media upload handling used across the admin. |
printing, products | Printing method and product configuration data. |
csrf | Refreshes the CSRF token for a long-lived admin tab. |
layout | Designer layout settings. |
Request rules
- Method: only actions listed as read actions answer
GETorHEAD. Any other action answers405. - Authentication: a request without the required admin capability answers
401. Thelicenseandaddonsresources can never be made public. - CSRF: a state-changing request needs a valid token in
X-CSRF-Token, or it answers403. - Rate limit: state-changing requests are limited per IP to 60 per minute for each resource (120 for clipart saves), then answer
429withRetry-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.
pricing/quote is public on purpose: it prices the submitted design with the shop's own rules and stores nothing.
Addon package endpoints
| Endpoint | Contract |
|---|---|
GET /api/v1/addons | Installed version, source/trust metadata, latest official version, update availability, and update_delivery: my_orders. |
POST /api/v1/addons/upload | Multipart file; optional license_key, allow_unsigned_custom=1. Restore adds replace_custom=1 and expected_slug. |
POST /api/v1/addons/state | JSON 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.