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.

The Print Trail for WooCommerce plugin is free to download from the WordPress plugin directory.

Using Medusa? See Medusa.

⚠️ 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:

  1. 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.
  2. Confirms the order when payment completes (the WooCommerce order reaches Processing or Completed). Print Trail then produces and ships it.
  3. 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.
  4. Sends your edits and partial refunds of Print Trail items to Print Trail until production starts, so the Print Trail order always matches what the customer is paying for.
  5. 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.
  6. 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). Use a channel of its own, not the ‘Standard’ channel
  • Your site must be reachable from the internet over HTTPS, on a public host name, so that Print Trail can send it updates. A shop on your own computer or on an http:// address cannot receive them; to test one, put it behind an HTTPS tunnel with a public host name
  • 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. You need three values from it:

  • the Channel ID, shown in the channel’s ID column (for example acme-shop)
  • the API token: click Token on the channel’s row. It is shown once when generated; generating a new one revokes the old one
  • the webhook secret: click Webhook secret on the channel’s row and confirm with Regenerate. This replaces the channel’s secret and shows the new one once, so paste it into the plugin straight away

👉 The plugin does not yet fetch the webhook secret from Print Trail by itself, so you need to copy it in. Without it, the plugin rejects every update Print Trail sends.

2. Install the plugin

In WordPress go to Plugins > Add New, search for Print Trail for WooCommerce, then click Install Now and Activate. 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.

Print Trail only sends updates to a public https:// address (see Webhook URL requirements), and refuses to register any other. If your site address in WordPress starts with http://, switch the site to HTTPS before you connect.

👉 The API endpoint is fixed at https://api.printtrail.com and 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:

  1. Edit the product and open the Inventory tab.
  2. Tick Fulfilled by Print Trail.
  3. 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. After it is confirmed, changes to its Print Trail items (a quantity changed, an item removed or added, where WooCommerce lets you edit the items) are sent until Print Trail starts production. The order stays confirmed, its fulfilments are rebuilt (their numbers can change) and its processing countdown starts again; the note shows Print Trail’s summary. Once production has started, the note says why the change could not be applied. An address change after confirmation is not sent; make it 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 of Print Trail items are sent the same way until production starts: a refunded quantity comes off the line, a fully refunded line is removed, and refunding every Print Trail item cancels the Print Trail order. If Print Trail refuses the change, or production has already started, the note gives Print Trail’s reason; cancel the order in Print Trail if it should not ship as it stands. Refunds that do not touch Print Trail items, such as shipping, leave the Print Trail order alone.

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 has no channel with that ID. Copy it again from Settings > Channels. Print Trail now answers a Channel ID that does not exist the same way as a bad token, so a wrong Channel ID usually shows as the API token is missing or invalid instead.
the API token is missing or invalid The token is wrong or has been regenerated, or the Channel ID is wrong (a Channel ID that does not exist gives this error). Copy the Channel ID again from Settings > Channels; if that does not help, generate a new token 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 or rejected.

  • If you (or anyone in your team) regenerated the webhook secret in Print Trail’s Settings > Channels (Webhook secret, then Regenerate) since setting up the plugin, the secret has changed and the plugin rejects updates signed with the new one. Copy the new secret into Print Trail Webhook Secret and save.
  • Check that your site is served over https:// on a public address. Print Trail does not send updates to an http:// address or to a site that is not reachable from the internet, and it does not follow redirects, so register the address your site finally answers on.
  • Check that the channel is switched on in Print Trail’s Settings > Channels. An inactive channel is sent no new updates, and the plugin’s requests are refused, until it is switched back on.
  • Otherwise, 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 is open source under GPL-2.0-or-later and published on WordPress.org.

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);