Schedule MacroRIS-SM-2068 – Shipping Label Generate & Upload to FTP

Shipping Label Generate & Upload to FTP

Automatically generates shipping label PDFs for eligible orders, downloads them, and uploads the files to an FTP server for external system integration.

Overview

The RIS-SM-2068 – Shipping Label Generate & Upload to FTP macro automates shipping label generation, download, and FTP upload for eligible orders. It ensures external systems have access to label files without manual intervention.

In simple terms:
Generate shipping label → Download PDF → Upload to FTP

Purpose

This macro:

  • Identifies eligible orders

  • Generates shipping label PDFs

  • Downloads label files

  • Uploads files to configured FTP location

👉 Ensures seamless label distribution to external systems.

When It Runs

Used for automated label generation and delivery.

Typically runs:

  • Scheduled execution (periodic)

  • Manual trigger

  • Processes orders from the last 1 day

  • For warehouse, courier, or external system integrations

Parameters

path
identifierstring
Required

Comma-separated order identifiers to filter eligible orders.

path
FTP_fullPathstring
Required

FTP upload path where PDF files will be stored.

path
FTP_passwordstring
Required

Password for FTP server authentication.

path
FTP_userstring
Required

Username for FTP server authentication.

path
FTP_serverstring
Required

FTP server URL or IP address.

path
FTP_SSLbool

Enable or disable SSL for FTP connection.

path
FTP_portint

Port number used for FTP connection.

Note:

  • Ensure all FTP credentials and paths are correctly configured.

  • Orders must match identifiers to be processed.

  • Only orders from the last 1 day are processed.

  • Limited to 200 orders per run.

Process Flow Step-by-Step

Start Macro

Log macro start message.

Filter Orders

Fetch open orders from the last 1 day.
Apply filters: LabelPrinted = false and matches provided identifiers.

Limit Processing

Sort orders by received date.
Limit processing to 200 orders per run.

Generate Label

For each order, call CreatePDFfromJobForceTemplate using template "Shipping Labels".
Receive PDF URL.

Download PDF

Use HTTP client to download PDF from URL and convert into byte array.

Upload to FTP

Upload PDF to FTP server.
File naming format: OrderNumber.pdf.

Logging

Log success messages for uploaded files and errors for failed uploads.
Maintain logs in internal buffer.

Final Output

If no eligible orders found, log a message.
Log macro completion.

Final Result

  • Shipping labels generated for eligible orders

  • PDF files downloaded and uploaded to FTP

  • External systems can access label files automatically

  • Full logging of process for tracking and error handling

Usefulness

This macro is highly beneficial for:

  • Automating label generation and delivery

  • Integrating Linnworks with external systems

  • Reducing manual effort

  • Handling bulk processing efficiently

  • Providing reliable logging and error tracking

Important Notes

  • Processes only orders from the last 1 day

  • Limited to 200 orders per run

  • Requires correct FTP configuration

  • Depends on valid print template setup

  • Orders must match identifiers to be processed

  • Network or FTP failures may impact upload

Example Scenario

Key Insight

This macro bridges Linnworks and external systems by fully automating shipping label generation and distribution, enabling seamless warehouse and courier integration with minimal manual effort.