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

Export Labels to 3PL via SFTP

Automatically find matching vendor channel orders, generate PDF label files, upload the labels to a configured SFTP folder for 3PL processing, and mark successfully uploaded orders with an identifier.

Overview

Export Labels to 3PL via SFTP is a scheduled label-export solution for Linnworks. It identifies eligible open orders, generates a PDF label file for each qualifying order, uploads the file to a configured SFTP folder, and marks successful orders with an export identifier.

The macro searches open orders associated with a configured Linnworks stock location. It then applies additional eligibility checks, including the vendor channel source, current despatch date, label-print status, and whether the export identifier has already been assigned.

For each eligible order, the macro generates PDF output using its configured print template and printer setup. The generated PDF URL and SFTP connection details are then passed to the configured upload service.

Only orders whose files upload successfully are assigned the export identifier.

Generate vendor-channel PDF labels automatically and deliver them to a 3PL through a scheduled SFTP export workflow.

Who Should Use Export Labels to 3PL via SFTP

Key Features

How Export Labels to 3PL via SFTP Works

Export Labels to 3PL via SFTP follows a defined sequence whenever its configured schedule runs.

Step 1: Validate required settings

The macro confirms that LocationName, SFTP_server, SFTP_user, and SFTP_password contain values.

Step 2: Apply optional defaults

If SFTP_port is blank, the macro uses port 22. If SFTP_fullPath is blank, it uses the default configured processing folder.

Step 3: Find the stock location

The configured LocationName is matched against the available Linnworks stock locations.

Step 4: Build the open-order date range

The macro searches recent open orders using a period from the previous 14 days through the next day.

Step 5: Retrieve location orders

Open orders associated with the matching stock location are retrieved.

Step 6: Apply order filters

The macro retains orders matching the configured vendor channel, current despatch date, and label-not-printed requirement.

Step 7: Exclude completed exports

Orders already carrying the configured export identifier are skipped.

Step 8: Generate each PDF

A PDF is generated for every remaining order using the configured print template and printer setup.

Step 9: Build the remote file path

The SFTP folder path is normalised and the order number is combined with _Shipping Labels.pdf.

Step 10: Upload the label file

The PDF URL, SFTP details, and remote file path are sent to the configured upload service.

Step 11: Track successful uploads

Orders are added to the successful-upload list only when the upload service confirms success.

Step 12: Apply the export identifier

The configured identifier is created when required and assigned to successfully uploaded orders.

Step 13: Record the execution result

Matching orders, PDF generation, upload responses, identifier assignments, order-level failures, general errors, and macro completion are logged.

Configure the Macro

Once the app has been installed, create a macro configuration so the system knows when the macro should run, which stock location should be checked, and where the generated PDF labels should be uploaded.

This configuration can be updated at any time to suit your operational requirements.

Steps to Configure

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

Key Benefits

Generating labels manually and transferring each file to SFTP can be repetitive and prone to delay. Export Labels to 3PL via SFTP combines order selection, PDF generation, upload, and successful-export identification into one scheduled process.

Reduce manual label handling while giving the 3PL a consistent SFTP location for incoming PDF files.

Usage of App

Export Labels to 3PL via SFTP is designed to run through the Linnworks Macro Schedule Engine.

It does not require selected OrderIds. Each execution searches open orders at the configured location and evaluates them against the macro's eligibility rules.

Execution

Trigger via Schedule

Configure a one-time or recurring schedule, enter the required location and SFTP values, save the configuration, and enable the macro.

Outcome

When the scheduled macro runs, it:

Validates the configuration

Confirms that the required stock location and SFTP connection values are available.

Retrieves recent open orders

Searches the configured stock location using the documented date window.

Filters eligible vendor orders

Retains orders matching the source, current despatch date, label status, and identifier requirements.

Generates a PDF label file

Uses the configured print template and printer setup for each eligible order.

Uploads the generated PDF

Sends the PDF URL and SFTP details to the configured upload service.

Marks successful orders

Applies the configured export identifier only when the upload is confirmed.

Records processing details

Logs matching orders, generated files, upload results, skipped orders, identifiers, and errors.

The remote file name follows this format:

{OrderNumber}_Shipping Labels.pdf

For example:

100245_Shipping Labels.pdf

A representative result is:

Order ResultMacro Behaviour
Eligible order and successful PDF uploadApplies the export identifier.
Eligible order but no PDF URL returnedLogs an error and skips the upload.
Eligible order but SFTP upload failsLogs the failure and does not apply the identifier.
Order already has the export identifierSkips the order.
Order despatch date is not todayExcludes the order from processing.
Label printed flag is already setExcludes the order from processing.
No eligible orders foundLogs a message and stops without uploading files.

Input Parameters

Export Labels to 3PL via SFTP uses the following configuration values:

ParameterRequiredDescription
LocationNameYesExact Linnworks stock location name used to retrieve open orders.
SFTP_serverYesHost name or address of the SFTP server.
SFTP_userYesUsername used by the SFTP upload connection.
SFTP_passwordYesPassword used by the SFTP upload connection.
SFTP_fullPathNoRemote folder used for uploaded label files. A default processing folder is used when blank.
SFTP_portNoSFTP connection port. Defaults to 22 when blank.
ScheduleYesOne-time or recurring schedule used to start the macro.
OrderIdsNoThe macro searches open orders directly and does not process selected order IDs.

Example configuration:

ParameterExample
LocationNameMain Warehouse
SFTP_serversftp.example.com
SFTP_usersftp_user
SFTP_passworddummy-sftp-password
SFTP_fullPath/labels/processing
SFTP_port22

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

The macro also relies on internal or previously configured values that are not named in the supplied parameter list:

Internal DependencyPurpose
Vendor channel sourceRestricts processing to the intended vendor-channel orders.
Export identifierPrevents repeat processing and marks successful uploads.
Print templateGenerates the PDF label output.
Printer setupSupports PDF generation through Linnworks.
Upload serviceTransfers the generated PDF from its URL to the SFTP destination.
Default processing folderUsed when SFTP_fullPath is blank.

The supplied documentation does not state the exact names or values of these internal settings.

Best Practices

Test order filtering, PDF generation, SFTP access, and identifier assignment with controlled orders before enabling a recurring production schedule.

The following checks can help diagnose common issues:

IssueCheck
Stock location is not foundConfirm that LocationName matches an active Linnworks location exactly.
No orders are selectedReview the location, vendor source, date, label-print flag, and export identifier conditions.
An expected order is skippedCheck whether its despatch date is today, the label flag is unset, and the export identifier is absent.
No PDF URL is returnedVerify the configured print template and printer setup.
SFTP upload failsConfirm the server, user, password, port, folder permissions, and remote path.
File is missing from SFTPReview the order-specific upload response in the macro log.
Identifier is not appliedConfirm that the upload service returned a successful result.
Wrong remote file location is usedReview SFTP_fullPath and the macro's folder-path normalisation.
Macro does not runConfirm that the configuration, schedule, and macro are enabled.

FAQ

How is Export Labels to 3PL via SFTP triggered?

The macro runs through a one-time or recurring schedule configured in Linnworks Macro Configuration.

Does the macro use OrderIds?

No. It retrieves open orders directly from the configured stock location.

Which macro should be selected in Macro Configuration?

Select Vendor Label SFTP Export.

Which parameters are mandatory?

LocationName, SFTP_server, SFTP_user, and SFTP_password are required.

What happens when SFTP_port is blank?

The macro uses port 22.

What happens when SFTP_fullPath is blank?

The macro uses its default configured processing folder.

Must LocationName match exactly?

Yes. The value must match the Linnworks stock location name used by the macro.

Which orders are searched?

The macro retrieves recent open orders from the configured stock location.

What date range is used for the open-order search?

The documented range covers the previous 14 days through the next day.

Which orders remain eligible after retrieval?

Orders must match the configured vendor channel, have a despatch date equal to the current date, have no label-printed flag, and not already carry the export identifier.

What happens when no orders match?

The macro logs that no matching orders were found and stops.

How is the PDF created?

The macro uses its configured print template and printer setup.

What happens when no PDF URL is returned?

The order is skipped and an error is written to the log.

How are uploaded files named?

Each file uses the order number followed by _Shipping Labels.pdf.

Does the macro connect directly to SFTP?

The source states that the PDF URL and SFTP details are sent to a configured upload service.

When is the export identifier applied?

Only after the upload service confirms that the PDF was uploaded successfully.

What happens when the upload fails?

The failure is logged and the order is not added to the successful-upload list.

Does the macro create the export identifier?

Yes. It creates the configured identifier when required before assigning it to successful orders.

Are orders with the identifier processed again?

No. They are skipped.

Does the macro set the label-printed flag?

The source states that the label-printed flag is checked during filtering. It does not state that this macro changes the flag.

Can multiple orders be processed during one run?

Yes. The macro can generate and upload multiple PDF files in one scheduled execution.

Does an error on one order stop all processing?

The documented behaviour states that an order-level error is logged and processing continues with the next order.

What happens when a general error occurs?

The error details are written to the macro log.

What should be checked when an expected order is missing?

Review its stock location, vendor source, despatch date, label-print status, and existing identifiers.

What should be checked when the SFTP file is missing?

Review the upload response, remote path, connection details, permissions, and order-specific log entries.

What should be checked when the macro does not run?

Confirm that the macro configuration is enabled and that the schedule has been saved and enabled.

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 shipping-label documents.

Summary

Export Labels to 3PL via SFTP automates scheduled PDF label generation and transfer for eligible vendor-channel orders.

Once configured and enabled, the macro validates the SFTP settings, finds the required Linnworks stock location, retrieves recent open orders, applies the vendor, despatch-date, label-status, and identifier filters, generates PDF label files, and uploads them to the configured SFTP folder.

For orders or files that do not process as expected, review the macro schedule and enabled status, confirm the exact stock location name, verify the SFTP connection and path, check the print-template output, and inspect the order-specific upload logs.