Contents
On this page

Hooks - Plugixa POS for WooCommerce

This page is for developers. The plugin fires WordPress actions and filters, all prefixed plugixa_pos_, that you can use from a theme’s functions.php or a small plugin of your own. Hooks marked PRO fire only when Pro is installed. See Free vs Pro.

The plugin also has hooks its own modules use to talk to each other. Only the ones below are meant for site developers; the others are listed at the end and may change between versions.

Amounts named “minor units” are whole numbers in the currency’s smallest unit (cents for EUR). $register is a register as stored: id, outlet_id (its store), code, name, status and settings.

Reacting to events

Sales and refunds

Action Arguments When it fires
plugixa_pos_order_created $order, $input After a register sale is fully recorded: WooCommerce order, stock and fiscal journal. $order is a WC_Order; $input is the sale as the register sent it. It also fires when a layaway PRO is paid in full, with $input holding only payments.
plugixa_pos_order_held $order, $input After a sale paid only in part is recorded: the order is kept, its stock reserved and the part payment journaled. plugixa_pos_order_created fires later, when it is paid in full.
plugixa_pos_before_stock_reduction $order, $register Just before WooCommerce reduces stock for a register sale.
plugixa_pos_refund_created $order, $payments, $refund, $items Once a register refund is recorded. $payments says how the money goes back, $refund is the WC_Order_Refund, $items is order item id => quantity refunded. Also fires for a partial refund PRO.
plugixa_pos_before_refund_restock $order, $register_id Just before WooCommerce puts refunded items back in stock. Also fires when a layaway PRO is cancelled.
plugixa_pos_quote_created PRO $quote After a quote was made. $quote is the quote as GET /quotes/{id} returns it.
plugixa_pos_quote_converted PRO $quote, $order When a quote was sold, with the quote marked converted and the sale’s WC_Order.

The sale and refund actions fire inside the database transaction of the sale or refund, so anything your listener writes to the database is saved or rolled back with it. To keep a copy of each register sale for another system:

add_action( 'plugixa_pos_order_created', function ( WC_Order $order, array $input ) {
	$order->update_meta_data( '_my_export_status', 'pending' );
	$order->save_meta_data();
	// Queue the order for your accounting tool, warehouse, ...
}, 10, 2 );

Cash sessions and the fiscal journal

Action Arguments When it fires
plugixa_pos_journal_appended $entry Each time a row is written to the fiscal journal, inside the transaction that wrote it. $entry holds register_id, seq, doc_no, event_type, order_id, session_id, payload, hash, id and created_at. Event types include sale, refund, session_open, session_close, cash_in, cash_out and duplicate, plus deposit and deposit_refund in Pro.
plugixa_pos_period_closed $register_id, $period, $key After a day, month or year closing was written. $period is day, month or year; $key is 2026-11-15, 2026-11 or 2026.

See Fiscal journal and Cash sessions for what these records are.

Stock

These fire only with Pro PRO.

Action Arguments When it fires
plugixa_pos_goods_received $product, $qty, $unit_cost, $outlet_id For each product received on a purchase order, before its stock goes up. $unit_cost is a decimal string.
plugixa_pos_stock_adjusted $adjustment, $product After a stock adjustment was logged (a count, damage, theft…). $adjustment is the row as GET /stock-adjustments lists it.
plugixa_pos_store_stock_counted $product, $outlet_id, $before, $after, $reason, $note When a store’s quantity for a product was typed in.
plugixa_pos_product_changed $product_id When something the registers show about a product changed outside WooCommerce: a store’s quantity or price, a bundle’s stock status, serial number tracking. Registers pick up the change on their next sync.

The plugin itself

Action Arguments When it fires
plugixa_pos_loaded $container Once the plugin has started, on every request.
plugixa_pos_activated On activation, once the tables exist.
plugixa_pos_deactivated On deactivation, before scheduled jobs are cleared. Modules clear their own jobs here.
plugixa_pos_migration_failed $failures When a database table could not be created or updated: module id => tables and reason.
plugixa_pos_uninstall When the plugin is deleted with the setting to delete its data on, before its tables are dropped.
plugixa_pos_settings_saved $settings After the settings were saved, with everything stored.
plugixa_pos_register_rest_routes $namespace, $container While the plugin registers its REST routes, under plugixa-pos/v1. See REST API.
plugixa_pos_admin_submenus $parent_slug, $render While the admin menu is built: add your own submenu under Plugixa POS. $parent_slug is plugixa-pos.
plugixa_pos_enqueue_assets $hook_suffix On the plugin’s admin screen, after the admin app’s scripts are enqueued.
plugixa_pos_register_enqueue On the /pos register page, before its head assets are printed: enqueue register-only styles or scripts here.
plugixa_pos_register_head Inside the register page’s <head>, to print extra tags.

Changing behavior

The register and its catalog

Filter Arguments What it changes
plugixa_pos_register_slug $slug The address of the register. Default pos, so the register opens at /pos.
plugixa_pos_user_can_use_register $allowed, $user_id, $register Whether a user may use a register. Only asked for an active register and a signed-in user. Return false to refuse.
plugixa_pos_sellable_types $types The WooCommerce product types the register sells. Default simple and variable.
plugixa_pos_product_query_args $args The arguments passed to wc_get_products() when the register loads a page of products.
plugixa_pos_product_payload $data, $product, $register What the register receives about one product. $register is null when no register asked.
plugixa_pos_register_bootstrap $payload What a register receives when it starts: outlet, registers, money, taxes, payment_methods and server_time.
plugixa_pos_payment_methods $methods The payment methods offered at the register. Each has id, type, label, opens_drawer and allow_change. The free plugin ships cash and card (a card terminal the cashier confirms by hand).
plugixa_pos_sync_interval $seconds How often registers ask the server for changes. Default 30, never below 5.
plugixa_pos_is_pos_request $is_pos Whether the current request belongs to the POS. POS requests are kept in the shop’s base currency when a currency switcher is active.

The slug filter must be added before WordPress’s init action, for example in your theme’s functions.php. Save Settings > Permalinks once afterwards so the new address works:

add_filter( 'plugixa_pos_register_slug', fn() => 'till' );

To keep one register for users who hold a capability of your own:

add_filter( 'plugixa_pos_user_can_use_register', function ( bool $allowed, int $user_id, array $register ) {
	if ( 2 === (int) $register['id'] ) {
		return $allowed && user_can( $user_id, 'my_gift_corner' );
	}
	return $allowed;
}, 10, 3 );

Prices, stock and checkout

Filter Arguments What it changes
plugixa_pos_available_stock $available, $product, $register The stock a register may sell from. Default: WooCommerce’s stock quantity. Pro answers with the register’s store quantity.
plugixa_pos_stock_tracked $tracked, $product Whether the register checks a product’s stock. Default: whether WooCommerce manages its stock.
plugixa_pos_unit_price $price, $product, $register A product’s unit price at a register, as a decimal string, in the same tax convention as WooCommerce’s prices.
plugixa_pos_line_pricing $pricing, $line, $product, $register The price of one sale line: price (decimal string), meta (rows of key and value printed on the line) and an optional discount in minor units for the whole line. Return a WP_Error to refuse the line.
plugixa_pos_line_adjustments $adjustments, $context, $input, $register, $sold_at Automatic discounts, by line index: lists of label and amount in minor units.
plugixa_pos_line_check $refusal, $line, $product, $register, $policy Refuse one line of a real sale. Return a WP_Error to refuse, null to let it through.
plugixa_pos_checkout_allowed $allowed, $order, $input, $register Last word on a sale before it is paid, with WooCommerce’s totals known. Return a WP_Error to refuse the sale.
plugixa_pos_locked_statuses $statuses, $order The statuses a register order may still move to. The plugin locks register orders once they are in the fiscal journal.

The price and stock filters, except plugixa_pos_line_check and plugixa_pos_checkout_allowed, also run when the register asks for a sale’s total before payment. That check runs in a transaction that is always rolled back, so do not count calls.

Receipts and sessions

Filter Arguments What it changes
plugixa_pos_receipt $receipt, $order The receipt of a register sale, before the register prints it. Keys include ticket, store, register, cashier, lines, taxes, total, payments, header, footer and fiscal.
plugixa_pos_session_report $report, $rows The figures of a cash session. $rows are the session’s journal rows.

To add a line under the receipt footer:

add_filter( 'plugixa_pos_receipt', function ( array $receipt, WC_Order $order ) {
	$receipt['footer'] = trim( $receipt['footer'] . "\nReturns within 30 days with this ticket." );
	return $receipt;
}, 10, 2 );

Fiscal records

Filter Arguments What it changes
plugixa_pos_fiscal_payload $payload, $order, $input, $register The fiscal record of a sale, before it is chained into the journal. Add to it here. Once written, it never changes.
plugixa_pos_fiscal_verify $result, $register_id The result of a journal check for one register. Return it with your own checks added.
plugixa_pos_fiscal_france PRO $enabled Whether the France fiscal pack is on. Default: the WooCommerce store address is in France.

Invoices

Filter Arguments What it changes
plugixa_pos_invoice_html PRO $html, $doc The HTML of an invoice or credit note, before it is stored. The document is frozen once issued. Pro also uses it for quotes and fills it with the layout from the invoice designer.
plugixa_pos_invoice_seller PRO $seller, $order The seller printed on invoices: company, address, tax_id, registration, email and phone.
plugixa_pos_dompdf_options PRO $options The Dompdf\Options used to turn invoices and credit notes into PDF.

Invoices are a Pro feature. See Invoices.

Settings, the admin app and the API

Filter Arguments What it changes
plugixa_pos_settings_defaults $defaults Default settings. A key of your own must also be cleaned in plugixa_pos_sanitize_settings, or it is dropped on save.
plugixa_pos_sanitize_settings $clean, $input The settings about to be saved. $clean is what the plugin already cleaned, $input the raw payload.
plugixa_pos_filter_output $data, $entity_type Every successful REST answer, before it is sent.
plugixa_pos_capabilities $map The permission flags handed to the admin app. They only hide controls: the server checks every request again.
plugixa_pos_admin_config $config The settings printed on the admin app’s page. Add nothing a user of that screen should not read.
plugixa_pos_bootstrap_payload $payload What the admin app loads when it starts.
plugixa_pos_public_request_captcha PRO $verdict, $request, $action Check a public request (one without a login) with a CAPTCHA service. Return false or a WP_Error to refuse. Actions: customer_display, stripe_webhook and adyen_link_webhook. Never refuse the two webhook actions: Stripe and Adyen cannot answer a CAPTCHA.
plugixa_pos_client_ip PRO $ip The address a public request is counted against for rate limits. Set it from your proxy’s header when the site sits behind one.

Pro modules

These filters exist only with Pro PRO.

Filter Arguments What it changes
plugixa_pos_pay_link_providers $providers The pay-by-link providers. Each is an object implementing PlugixaPos\Pro\Modules\PayLinks\Services\Providers\Provider.
plugixa_pos_product_cost $cost, $product A product’s unit cost when it has none of its own. Pro’s bundles answer with their components’ cost.
plugixa_pos_stripe_unmatched_grace $seconds How recent a Stripe Terminal payment may be and still be left out of the list of card payments with no sale. Default 600.
plugixa_pos_webhook_allow_http $allowed, $url Allow a webhook address that starts with http://. Default false.
plugixa_pos_webhook_destination_allowed $allowed, $url, $ip Allow a webhook address the checks refuse, such as a system on your own network. $ip is what the host resolved to.
plugixa_pos_webhook_drain_seconds $seconds How long one run may spend sending queued webhooks. Default 20.

Internal hooks

These connect the plugin’s own parts and may change: plugixa_pos_modules, plugixa_pos_module_roots, plugixa_pos_edition, plugixa_pos_app_build_dir, plugixa_pos_admin_i18n_strings, plugixa_pos_config_settings_keys, plugixa_pos_settings_choices, plugixa_pos_register_files, plugixa_pos_checkout_policy, plugixa_pos_line_options, plugixa_pos_payment_line, plugixa_pos_refund_payments, plugixa_pos_session_counted, plugixa_pos_fiscal_signature, plugixa_pos_db_transaction_mode, plugixa_pos_entity_types, plugixa_pos_entity_fields, plugixa_pos_filterable_fields, plugixa_pos_filter_api_bases, plugixa_pos_unreadable_fields, plugixa_pos_search_fragments, plugixa_pos_query_clauses, plugixa_pos_record_names, plugixa_pos_record_writers, plugixa_pos_load_record, plugixa_pos_user_can and plugixa_pos_fs_loaded.

The plugin also carries hooks from a shared data layer that nothing in this version writes through, so they do not fire: plugixa_pos_before_insert, plugixa_pos_before_update, plugixa_pos_can_delete, plugixa_pos_can_purge, plugixa_pos_{$entity}_delete_blockers (the name carries the record type), plugixa_pos_before_delete, plugixa_pos_before_purge, plugixa_pos_entity_created, plugixa_pos_entity_updated, plugixa_pos_entity_field_changed, plugixa_pos_entity_assigned, plugixa_pos_entity_deleted, plugixa_pos_entity_restored, plugixa_pos_entity_purged and plugixa_pos_before_send_mail.

Hooks are not webhooks: they run inside WordPress. The outgoing HTTP calls Pro sends to other systems are described on the Webhooks page.

Quick Links

Share