Developer reference
printIQ mapping format, hooks and developer contracts
Reference the product mapping schema, required-question contract, speed settings, hooks and private handoff behaviour.
Guide source reviewed for PressFlow 2.2.5.
Developer contracts
The portable integration format is pressflow.printiq.product/1. Input requests contain exactly one of ProductCode, SalesItemCode or CustomProduct, with optional local QuestionAnswers instructions. The top-level optional production object controls the matrix source, field, speeds and calendar. Customer context, quantity, kinds and the price-only guards are supplied by the connector. Credentials, artwork URLs, quote identifiers, acceptance and invoice actions do not belong in a mapping.
QuestionAnswers entries use question, context, optional section/line, item and exactly one of value or values. The transport strips this local envelope before GetPrice. It obtains the current question identifiers, binds them to the fresh product/quantity, calls SaveQuoteQuestions and GetPriceForProduct without accepting or invoicing, then verifies the new details and answers. Pricing contexts remain temporary; persistent staff-reviewed job quotes do not receive an auto-removal flag. The generic read API does not expose arbitrary question-save or recalculation writes.
For production.source = "shop", the source plan contains the base specification fields; PressFlow adds its own required speed axis and expands the verified price index locally. Each speeds entry has id, label, integer days, optional percent and optional fixed. For production.source = "printiq", an existing production.field identifies independently mapped supplier services, or one virtual Standard service is used. Supplier TurnaroundDays/TurnaroundHours are normalised per verified quantity. The optional supplier_prices[*].production_days index is validated alongside its complete-job prices. The calendar uses that index without further HTTP requests.
pfw_printiq_product_mapping filters a manager-started mapping before validation. Arguments are the mapping array and destination WooCommerce product ID (0 for a new draft). Return a valid mapping. This filter can adapt an external catalogue into stable PressFlow choices; it cannot bypass schema validation or change the price-only transport guards. Scheduled refreshes reuse the saved validated plan.
pfw_printiq_prices_refreshed runs after a verified index commits. Arguments are the product ID and a summary containing product_id, checked_at, prices and specifications. Credentials and customer codes are absent. Use it to invalidate an integration’s own caches. A failing listener does not roll back an already committed index.
Private product metadata uses _pfw_printiq_mapping. _pfw_printiq_job retains the selected source request, customer/context, quantity, source net total and configuration hash on the order item. _pfw_printiq_handoff is a compact, rebuildable staff projection. Canonical handoff state, attempts, approved file assignments and protected transfer secrets live in the transactional printiq_job bucket in the operations table, keyed by order_id:item_id.
Administration uses capability checks, nonces, an order artwork lock and expected ledger/job revisions. Public admin-post.php?action=pfw_printiq_artwork downloads require a valid file-specific signature and current approval checks. Exclude this action from page caching, URL rewriting and external URL scanners that retain signed query strings. Never expose handoff ledgers or protected secrets through custom REST responses. The raw pricing call() API remains read-only/price-only; persistent writes use a separate guarded transport without automatic retries.
QuoteProcess uses query-string authentication parameters. PressFlow keeps these server-side, enforces public HTTPS and zero redirects, encrypts cached login tokens, and does not expose raw upstream error bodies. Configure HTTP-debugging, proxy and observability tools to redact printIQ credential and LoginToken query values.
pfw_printiq_address_country_name filters the canonical English country name with the ISO alpha-2 code as its second argument. pfw_printiq_address_state_name receives the English region name, ISO country code and original region code. Return a non-empty valid country name; do not change the destination. These hooks support tenant-specific naming aliases while preserving the original WooCommerce address and round-trip country/service checks.
The staff-only job transport additionally permits the narrow UpdateFreightSession and ApproveQuote requests. Delivery updates accept only the saved destination/contact, selected service and mandatory reprice/initial-delivery flags. Shared address/contact keys, third-party billing accounts, invoice flags and arbitrary writes are rejected. Both operations receive durable attempt records and a fresh scoped quote read; they are never automatically retried.
Example product mapping
Use your own valid source codes. Prices are obtained from printIQ, not entered in this JSON.
{
"schema": "pressflow.printiq.product/1",
"quantities": [100, 250, 500],
"fields": [
{
"id": "paper",
"label": "Paper stock",
"type": "cards",
"required": true,
"default": "silk",
"group": "material",
"options": [
{"id": "silk", "label": "Silk", "graphic": "silk"},
{"id": "uncoated", "label": "Uncoated", "graphic": "uncoated"}
]
}
],
"specifications": [
{
"choices": {"paper": "silk"},
"request": {"ProductCode": "YOUR-SILK-SKU"}
},
{
"choices": {"paper": "uncoated"},
"request": {"ProductCode": "YOUR-UNCOATED-SKU"}
}
]
}Hook examples
The mapping hook receives the requested mapping and destination product ID. This example leaves it unchanged.
add_filter('pfw_printiq_product_mapping', function ($mapping, $product_id) {
return $mapping;
}, 10, 2);
add_action('pfw_printiq_prices_refreshed', function ($product_id, $summary) {
// Invalidate your own cache for this product after verified prices commit.
}, 10, 2);Continue the printIQ setup
- Connect printIQ to your PressFlow shop
- Import printIQ products, options and prices
- printIQ delivery rates, service mapping and weights
- Send quotes, jobs and approved artwork to printIQ
- printIQ production progress and customer emails
- Troubleshoot the printIQ connection
Need a hand?
Contact the PressFlow team with details of what you are trying to do.