Schedule MacroRIS-SM-PRINTING LABELS VIA SFTP TO 3PL

Printing Labels via SFTP to 3PL

Automatically find today's vendor channel orders at a stock location, generate a PDF label file for each order, send the files to a 3PL SFTP folder, and tag the processed orders with an export identifier.

Overview

Printing Labels via SFTP to 3PL is a scheduled label-export solution for Linnworks. It finds open vendor channel orders that are due for despatch today, generates a PDF label file for each order, and sends the files to an SFTP server used by a third-party logistics (3PL) provider.

The macro runs from the Linnworks Macro Schedule Engine. Each time it runs, it searches open orders at the configured stock location, keeps only the orders that match the vendor channel, are due for despatch today and do not yet have a printed label, and generates one PDF per order using the print template defined in the macro.

Each PDF is passed to an upload service together with the SFTP connection details, and the service places the file in the 3PL processing folder. After all orders are handled, the macro tags the processed orders with an export identifier so they can be found easily in Linnworks.

Printing Labels via SFTP to 3PL removes the daily task of generating, downloading and uploading label PDFs by hand, and gives the 3PL a consistent SFTP folder for incoming label files.

Who Should Use Printing Labels via SFTP to 3PL

Key Features

How Printing Labels via SFTP to 3PL Works

Printing Labels via SFTP to 3PL runs through a defined sequence each time its schedule runs. It does not use selected order IDs; it searches open orders directly.

Step 1: Stock location lookup

The macro finds the Linnworks stock location whose name exactly matches the LocationName parameter.

Step 2: Open order search

Open orders at that location with a received date from the previous 14 days up to the next day are retrieved.

Step 3: Vendor channel filter

Only orders whose source matches the vendor channel defined in the macro are kept.

Step 4: Despatch and label filter

Orders are kept only when the despatch-by date is today and the order's label has not been printed.

Step 5: PDF generation

A PDF is generated for each remaining order using the print template defined in the macro.

Step 6: SFTP upload

The PDF link, the SFTP connection details and the remote file path are sent to the upload service, which places the file in the 3PL processing folder.

Step 7: Upload result logging

The response from the upload service is written to the macro log for each order.

Step 8: Export identifier assignment

The export identifier is created if required and assigned to the processed orders.

Configure the Macro

Once the app is installed, you need to create a macro configuration so the system knows when the macro should run, which stock location to check, and which SFTP server should receive the label files.

This setup can be adjusted anytime based on your operational requirements.

Steps to Configure

Go to Apps > Macro Configuration and click + Add new configuration.

Key Benefits

Generating label PDFs one by one and uploading each file to a 3PL server is repetitive and easy to delay. Printing Labels via SFTP to 3PL combines order selection, PDF generation and SFTP delivery into one scheduled process.

Reduce manual label handling and give the 3PL a predictable folder of label files for every despatch day.

Usage of App

Printing Labels via SFTP to 3PL is triggered through the Linnworks Macro Schedule Engine.

It does not use selected OrderIds. Each run searches open orders at the configured location and applies the order selection rules.

Execution

Trigger via Schedule

Configure a one-time or recurring schedule, enter the location and SFTP values, save the configuration, and enable both the schedule and the macro. No manual input is required once the schedule is active.

Outcome

When the scheduled macro runs, it:

Finds the stock location

Matches the LocationName parameter against the Linnworks stock locations.

Retrieves recent open orders

Searches open orders received from the previous 14 days up to the next day at that location.

Selects today's vendor channel orders

Keeps orders from the vendor channel with a despatch-by date of today and no printed label.

Generates a PDF label file

Creates one PDF per order using the print template defined in the macro.

Uploads the PDF to SFTP

Sends the PDF link and SFTP details to the upload service and logs the result.

Tags the processed orders

Creates the export identifier if needed and assigns it to the processed orders.

Each remote file is named using this format:

{OrderNumber}_Shipping Labels.pdf

For example:

100245_Shipping Labels.pdf

The table below shows how the macro handles different situations:

Order SituationMacro Behaviour
Matching order, PDF generated and upload succeedsFile is placed on SFTP, success is logged and the export identifier is assigned.
Matching order, but the upload service reports a failureThe failure is logged. The export identifier is still assigned.
Matching order, but no PDF link is returnedNo file is uploaded. The export identifier is still assigned.
Error while generating the PDFThe order is skipped and does not receive the export identifier.
Despatch-by date is not todayThe order is not processed.
Label is already marked as printedThe order is not processed.
Order source is not the vendor channelThe order is not processed.
No matching orders found"Order not found!" is logged and no files are uploaded.

Input Parameters

Printing Labels via SFTP to 3PL uses the following values from the Macro Configuration screen:

ParameterRequiredDescription
LocationNameYesExact Linnworks stock location name used to search open orders. The match is case-sensitive.
SFTP_serverYesHost name or address of the 3PL SFTP server.
SFTP_userYesUsername for the SFTP connection.
SFTP_passwordYesPassword for the SFTP connection.
SFTP_fullPathYesFolder path on the SFTP server, passed to the upload service. Set it to the 3PL processing folder.
SFTP_portYesSFTP port, passed to the upload service. Usually 22.
ScheduleYesOne-time or recurring schedule that starts the macro.

Security: Store SFTP credentials securely. Do not expose live usernames, passwords, server addresses or private folder paths in public documentation, screenshots, logs or source repositories.

The following behaviour is defined within the macro code and is not set in the Macro Configuration screen:

SettingDescription
Vendor Channel SourceThe order source that the macro processes. Orders from other sources are ignored.
Print TemplateThe Linnworks print template used to generate each PDF.
Remote File PathThe 3PL processing folder and the {OrderNumber}_Shipping Labels.pdf file name format.
Export IdentifierThe identifier created and assigned to processed orders.
Upload ServiceThe service that transfers each PDF from its link to the SFTP server.
Order Search WindowOrders received from the previous 14 days up to the next day.

Order Selection Rules

An order is processed only when it meets every rule below:

RuleCondition
Order statusThe order is an open order.
Stock locationThe order belongs to the stock location named in LocationName.
Received dateThe order was received within the previous 14 days up to the next day.
Order sourceThe order source matches the vendor channel defined in the macro.
Despatch-by dateThe despatch-by date is today.
Label statusThe order's label has not been marked as printed.

Important: The macro does not mark labels as printed and does not skip orders that already carry the export identifier. An order that still matches these rules is sent again if the macro runs again on the same day.

Best Practices

Testing with a small number of orders and reviewing the logs after each run are key to getting the best results from Printing Labels via SFTP to 3PL.

The following checks can help diagnose common issues:

IssueCheck
Macro does not runConfirm that the configuration, the schedule and the macro are all enabled.
No orders are processedCheck the location name, the order source, the despatch-by date and the label printed status.
An expected order is missingConfirm the despatch-by date is today and the order was received within the last 14 days.
File is missing on SFTPReview the upload result for that order in the macro log, then check the SFTP details and folder permissions.
Same file uploaded twiceCheck whether the schedule runs more than once a day.
Macro stops with an errorReview the error in the macro log. A location name that does not match exactly stops the run.

FAQ

How is Printing Labels via SFTP to 3PL triggered?

The macro runs from a one-time or recurring schedule set up in Linnworks Macro Configuration.

Does the macro use OrderIds?

No. It searches open orders at the configured stock location on every run.

Which parameters must be filled in?

All six parameters are needed: LocationName, SFTP_server, SFTP_user, SFTP_password, SFTP_fullPath and SFTP_port. The macro does not apply default values.

Must LocationName match exactly?

Yes. The name must match the Linnworks stock location exactly, including upper and lower case. If no location matches, the run stops and the error is written to the log.

Which orders are processed?

Open orders at the configured location, received within the previous 14 days up to the next day, from the vendor channel defined in the macro, with a despatch-by date of today and no printed label.

Are orders due for despatch on another day included?

No. Only orders with a despatch-by date of today are processed.

How many PDF files are created?

One PDF is created for each processed order.

How are the files named?

Each file is named with the order number followed by _Shipping Labels.pdf, for example 100245_Shipping Labels.pdf.

Does the macro connect to the SFTP server directly?

No. The macro sends the PDF link and the SFTP details to an upload service, which transfers the file to the SFTP server.

When is the export identifier assigned?

At the end of the run, to every order that was processed. It is assigned even when the upload for that order failed, so use the macro log to confirm each upload.

Does the macro create the export identifier?

Yes. If the identifier does not exist in Linnworks, the macro creates it before assigning it.

Does the macro mark the label as printed?

No. The macro checks the label printed status when selecting orders but does not change it.

What happens if the macro runs twice on the same day?

Orders that still match the selection rules are processed again, and their label files are uploaded again.

What happens when no orders match?

The macro logs "Order not found!" and finishes without uploading any files.

Does an error on one order stop the whole run?

No. If an error occurs while generating the PDF for an order, that order is skipped and the macro continues with the next order.

Can the vendor channel, print template or folder be changed?

Yes, but these values are defined in the macro code. The code must be updated and tested before the change is used in a live workflow.

Please review these pages to understand how data is handled and the terms governing the use of this application.

Access to the macro configuration should be restricted because it contains SFTP connection details and controls the automatic export of label documents.

Summary

Printing Labels via SFTP to 3PL automates the daily delivery of label PDFs for vendor channel orders to a 3PL SFTP server.

Once configured and scheduled, the macro finds the stock location, retrieves recent open orders, keeps the vendor channel orders due for despatch today without a printed label, generates one PDF per order, sends each file to the 3PL processing folder and tags the processed orders with an export identifier.

For orders or files that do not process as expected, confirm that the schedule and macro are enabled, check the exact stock location name, verify the SFTP details and folder permissions, and review the order-specific upload results in the macro log.