REST API and extension hooks
Integrate Free rule management and supported extension contracts.
Reviewed 2026-08-05
Authentication and permissions
Management routes use the namespace /wp-json/laqi-osa/v1 and require an authenticated WordPress user who can manage WooCommerce. Use normal WordPress REST authentication and nonce or application-password handling for the client involved.
Do not expose a privileged REST nonce or application password in public browser code.
Route groups
/rulesand/rules/{id}list, create, read, update, and delete rules./rules/reorder,/rules/test, and/rules/{id}/applymanage priority and controlled testing or application./rules/exportand/rules/importtransfer validated rules./rules/explainreturns the condition trace for an order and rule./settingsand/logmanage global Free settings and activity./metaand/searchprovide rule-builder field data and store-value search.
Inspect the WordPress REST index on the exact installed plugin version for supported methods and argument schemas before building an integration.
Lifecycle hooks
laqi_osa_rule_firedruns after all actions for a firing.laqi_osa_should_apply_rulecan veto a firing before actions run.laqi_osa_before_actionandlaqi_osa_after_actionwrap each individual action.
Use vetoes sparingly and keep callbacks fast. Slow network work should be queued rather than performed inside rule evaluation.
Add rule-building options
The plugin can be extended through:
laqi_osa_action_registryandlaqi_osa_action_typesfor a custom action and its editor fields.laqi_osa_fieldsfor a condition field and order-value resolver.laqi_osa_operatorsfor a custom comparison operator.laqi_osa_rule_templatesfor a starter template.
The trigger-registry and admin-extension contracts are versioned developer surfaces. Inspect the plugin’s bundled docs/trigger-registry-contract.md and docs/admin-extension-contract.md for the exact interface and lifecycle requirements of the installed version.
An extension must validate and sanitize its configuration, remain compatible with PHP 7.4 where required by the store, and use WooCommerce order APIs instead of direct database writes.