Main Scripts

Dropshipping Script

14min

This script is used to automate the dropshipping process for dropshippers working with clients. Concept is to automate the process of dropshipping from Linnworks Account to the dropshipper. The script will automatically search for orders on linnworks, export them to a dropbox folder, and then automatically send email of the orders to the dropshipper. The dropshipper will then send the tracking number back to the script, which will then update the tracking number on linnworks.

All scripts for this are similar, for the sake of Documentation we will use Complete Automotive Dropship.

Installation

  1. Clone the repository and install the dependencies
Shell

  1. Create a new file called .env and add the following variables
Shell

  1. Run the script
Shell


Code Structure

Script Structure

Shell


Documentation

Configuration Module

This module contains the configuration variables and File paths used in the script. For every droshipper, you must add new configuration variables

Dropbox configuration

  • dropbox_connect() - this function is used to establish a connection with Dropbox. It returns a Dropbox object that can be used for further operations.
Python


send email module

  • downloadfromdbx - This function uses the dropbox object to download files from Dropbox to a local path.
Python

  • send_to_db - This function is used to save new oprders from a CSV file to a SQLite database.
  • send_email - This function is used to send emails to the Dropshipper if there are any new Orders.

Code snippet

Python


Download Mail Module

  • download_from_mail - This function is used to download attachments from unread emails. It fetches all unread messages and marks them as read.
Python

  • upload_to_dropbox - This is uses the dropbox object to upload the downloaded files to a dropbox.
Python


This is a general overview of the Dropshipping Script. With the Information provided you will be able to run the script seamlessly.