Developer reference
Company access, financial records and extension boundaries
Read company context safely and preserve server permissions, approvals, credit and private templates.
Guide source reviewed for PressFlow 2.0.5.
Company context is server-owned
Base portals use the private pfw_company post type. Membership, company/branch assignments and the pricing revision are server data. Each member has one company context. The normal WooCommerce role is not replaced by a corporate role and corporate membership grants no WordPress administrator capability.
Use the current access helpers when building a permitted integration: PFW_B2B_Access::allowed($product_id, $buy) checks product access and PFW_B2B::can_view_order($order) scopes company order access. These are version-bound class APIs, not public endpoints. Never trust a company ID supplied by a browser in place of the current membership.
Company-aware snapshots bind the pricing revision and company. Preserve that binding across the configurator, Quick Order, saved jobs, templates, basket and order creation. Reordering checks current products/prices and creates an independent job; historical approval does not authorise new artwork or purchasing.
Optional credit tables
Company credit uses indexed InnoDB tables with suffixes pfw_credit_accounts, pfw_credit_orders and pfw_credit_events, using the site's actual prefix. Monetary records use integer minor units and retain precision. WooCommerce orders remain the commercial source for totals and taxes.
Account writes use company locks and transactions. Existing migration is bounded and resumable; pending reconciliation can hold new credit. A private recovery export is a financial data export, not a public feed or automatic import interface. Do not update a balance through direct SQL or product/user metadata. Do not start a conflicting transaction around internal account writers.
The pfw_b2b_credit_storage_ready action observes legacy conversion readiness; it is not a receipt or a cleared-account event. A WooCommerce processing status alone does not prove a company payment was received.
Brand artwork
Native and approved Canva templates have published versions and trusted generated-artwork handoffs. Preserve their seal, company, product geometry and version checks. Do not create an arbitrary upload that impersonates a trusted template. Retirement/feature-off and company-access changes must continue to reject new unauthorised generation.
JSON field import has a documented declarative format, not executable expressions. Positions use millimetres from top-left full bleed. Only writable named PDF text widgets can supply measured form positions; there is no OCR or automatic deletion of flattened text. See field import.
Verify isolation
Use separate customer accounts/browser profiles for two companies and each role. Check direct product links, Store API reads, account/order/file links, removed membership, branch restrictions, private caching, simultaneous account purchases and receipt/refund recovery. Shop-manager accounts bypass customer restrictions and cannot prove customer isolation.
Example files
Reference examples for adapting to your shop. PHP examples are not plugin installers; review the guide and replace sample IDs before using them.
Need a hand?
Contact the PressFlow team with details of what you are trying to do.