WooCommerce
The Print Trail for WooCommerce plugin sends orders for your Print Trail products to Print Trail automatically, and brings stock levels, fulfilment progress and tracking numbers back into WooCommerce.
⚠️ An active Print Trail account is required to use the Print Trail for WooCommerce plugin.
What the plugin does
For each WooCommerce order that contains Print Trail products, the plugin:
- Creates a Print Trail draft order at checkout, containing only the Print Trail lines. Other products in the same order are left for you to fulfil as usual.
- Confirms the order when payment completes (the WooCommerce order reaches Processing or Completed). Print Trail then produces and ships it.
- Keeps the WooCommerce order up to date as the fulfilment progresses. Print Trail pushes every order, fulfilment and tracking change to your site by webhook, within seconds, and each is recorded as an order note. The plugin also checks order details every few hours, in case a webhook was missed.
- Cancels the Print Trail order if the WooCommerce order is cancelled or fully refunded, while Print Trail can still stop it. If it is too late, the order note tells you which fulfilments can no longer be cancelled.
- Keeps WooCommerce stock quantities current for every product you have flagged. Print Trail pushes stock changes to your WooCommerce site by webhook, and the plugin requests a full stock sync once a day as a safety net. It is WooCommerce’s own stock figure that decides whether a customer can add a product to their basket and check out; Print Trail’s actual stock is checked when the paid order is confirmed (see Stock).
Prices are never sent to Print Trail. The plugin sends SKUs, quantities and the delivery details only.
Requirements
- WordPress 6.4 or later, WooCommerce (HPOS compatible)
- PHP 8.1 or later
- A Print Trail team with a channel for this shop (see below)
- Your WooCommerce SKUs must match your Print Trail product SKUs (or you can set a per-product override — see Flag your products)
Before you install: existing orders
The plugin never touches orders that already exist when it is installed, with one exception: if you open an older order that is still in Processing and click Update after the plugin is configured, the plugin will create and confirm a Print Trail order for it — and Print Trail will ship it.
If you have a backlog of Processing orders that were already fulfilled some other way, mark them Completed before configuring the plugin. Completed, cancelled and refunded orders are never sent to Print Trail.
Set up
1. Create a channel and credentials in Print Trail
In the Print Trail app go to Settings > Channels and create a channel for your shop. Enable API credentials on it. You need three values:
- the Channel ID (for example
acme-shop) - the API token — shown once when generated; regenerating it revokes the old one
- the webhook secret
2. Install the plugin
In WordPress go to Plugins > Add New > Upload Plugin, upload the plugin zip, and activate it. Activation has no side effects: nothing is sent anywhere until you enter credentials.
3. Connect
Go to WooCommerce > Settings > Print Trail (there is also a Settings link under the plugin on the Plugins page). Paste in the Channel ID, API token and webhook secret and Save.
Click Test connection. A successful test names your channel and team, for example Connected — channel shop (sho) [acme-shop] · team Acme (acme).
The test also registers the webhook: it tells Print Trail to send order, fulfilment and tracking updates to this site. The Connection section shows where Print Trail is currently sending. If you later move or clone the site, that section offers a Re-register webhook button.
👉 The API endpoint is fixed at
https://api.printtrail.comand shown read-only. You do not need to change it.
4. Map shipping methods
On the same settings tab, each of your WooCommerce shipping-zone methods has a dropdown of the shipping methods your Print Trail channel offers. Choose the Print Trail method that each WooCommerce method should use, and Save. Any method you do not change uses your default (Standard unless you set otherwise).
5. Flag your products as fulfilled by Print Trail
Only products you flag are sent to Print Trail. For each one:
- Edit the product and open the Inventory tab.
- Tick Fulfilled by Print Trail.
- If the WooCommerce SKU is different from the Print Trail SKU, enter the Print Trail SKU in Print Trail SKU. Leave it blank when they match.
Variable products have the same two fields on each variation. A variation with no setting of its own inherits the parent product’s flag.
SKUs are matched case-insensitively against the SKU you gave the product in Print Trail (not the Print Trail order-number prefix). Within a day of flagging products the first full stock sync runs (stock webhooks start sooner); if any flagged SKU does not match a Print Trail product, an admin notice lists it.
From the moment products are flagged, new orders for them go to Print Trail.
6. Check with a test order
Place a small order for a flagged product and pay for it. On the WooCommerce order screen you should see:
- an order note that the Print Trail draft was created, listing the SKUs
- on payment, a note that it was confirmed, with the Print Trail order number
- a Print Trail panel below the order items, linking to the order and each fulfilment in the Print Trail app, with a Refresh button
- further notes as the fulfilment progresses and ships
Cancel the test order in Print Trail afterwards if you do not want it shipped.
How updates reach your site
The plugin relies on webhooks. When you run Test connection it registers your site’s webhook URL with Print Trail, and from then on Print Trail pushes each change — order confirmed, fulfilment started, tracking number issued, order dispatched or cancelled, stock moved — to your site as it happens. Order events arrive within seconds; stock changes are batched and delivered a little less often. Print Trail queues and retries deliveries, so a brief outage on your site does not lose them.
Polling is the fallback, not the mechanism. Two background jobs run on WooCommerce’s scheduler:
| Job | Purpose |
|---|---|
| Reconciliation sweep (every few hours) | Asks Print Trail for any orders changed since the last sweep, in case a webhook could not be delivered. |
| Stock sync (once a day) | Pulls current stock for every flagged product, in case a stock webhook was missed, and refreshes the list of flagged SKUs Print Trail does not recognise. |
Both are a single request to Print Trail per run and add no measurable load to your site. Developers can change either interval — see For developers.
Day to day
Order notes are the audit trail. Everything the plugin does, and everything Print Trail reports back, lands as a note on the WooCommerce order.
Editing an order. While the Print Trail order is still a draft (before payment), saving the WooCommerce order re-sends it. Once confirmed, edits in WooCommerce are not sent; make changes in Print Trail.
Cancelling. Cancel or fully refund the WooCommerce order and the plugin asks Print Trail to cancel. If production has already started you will be asked to confirm on the order screen, and the note tells you if any fulfilment could not be stopped.
Partial refunds are noted but not sent — Print Trail has no per-item cancel. Amend or cancel the affected items in Print Trail.
Stock. WooCommerce stock for flagged products is overwritten from Print Trail as it changes (by webhook) and in full once a day. From the customer’s point of view, WooCommerce’s stock figure is what gates the basket and checkout: if it says in stock, they can buy and pay. Print Trail’s actual stock is checked only after payment, when the plugin confirms the order. If Print Trail has less than the customer bought — the figure was slightly stale, or another channel sold the last one — the WooCommerce order is placed on hold with a note naming the shortfall, WooCommerce’s stock for that product is corrected immediately so no one else can buy it, and the confirmation is retried automatically. You then decide whether to wait for a restock or refund the customer. Variations whose stock is managed by the parent product are never written.
Address problems. If Print Trail rejects an address, the note says which fields. Fix the address and save the order to re-send.
Troubleshooting
| Message from Test connection | Meaning |
|---|---|
| channel “…” was not found. Check the Channel ID | Print Trail answered but has no channel with that ID. Copy it again from Settings > Channels. |
| the API token is missing or invalid | The token is wrong or has been regenerated. Generate a new one and paste it in. |
| This token belongs to channel X, but your settings use channel Y | Token and Channel ID are from different channels. Use the matching pair. |
| … does not serve the Print Trail API | The plugin is not reaching Print Trail’s API. If your developer has defined PT_WOO_BASE_URL in wp-config.php, remove it. Otherwise contact support. |
Updates are not arriving. Order updates should appear within seconds of the change in Print Trail. If they only appear hours later, the reconciliation sweep is doing the work and webhooks are being blocked. Ask your host or security plugin to allow POST requests to /wp-json/printtrail/v1/webhook, then use Re-register webhook on the settings tab.
An old order was sent to Print Trail unexpectedly. See Before you install. Cancel it in Print Trail.
For developers
The plugin uses the Print Trail API. It is open source under GPL-2.0-or-later.
Both background jobs can be tuned from a theme or mu-plugin. Values are in seconds (minimum 60); a change takes effect on the next page load.
add_filter('pt_woo_reconcile_interval', fn () => 12 * HOUR_IN_SECONDS);
add_filter('pt_woo_stock_sync_interval', fn () => 12 * HOUR_IN_SECONDS);