In this script we check source and the country of an order, if its AMAZON or EBAY, then we evaluate total cost and weight of an order and assign postal service accordingly.
Sample Script - Assign Shipping Service to an order
This script will go through all order items and check the prefered shipping method for the item, grab the last item in the order and assign order to the service. Then check if the order value is greater than 100 and then assign to Recorded Shipping.
This script is designed to allocate a shipping method based upon a partial match on a postal code.
Sample Script - Assign shipping service to an order based upon Post code
This script is designed to allocate a shipping method based upon a pacakaging that has been auto allocated.
Sample Script - Assign shipping service to an order based upon Packaging
This script does the following: Checks against the postcode of the order and if found within list will allocate the postcode based upon the condition provided.
Sample Code - Assign postal service based upon post code.
The script will iterate through order item and allocate an order to a folder based on the extend property of an stock item. For example if you put Extended property for a stock item with the name To Folder and property value is Some Special Folder, when Linnworks sees this stock item in the order it will allocate the order to folder Some Special Folder.
Script Sample - Assign an order to a folder based on the extended property of an order item
The script will iterate through order audit trail and allocate an order to a folder if the Invoice has been printed
Script Sample - Assign an order to a folder based on the Audit Trail of the Order
The script checks whether fulfilment center Fulfilment Center Name has sufficient stock for all order items, if yes then the order is automatically allocated to the fulfilment center
Sample Script - Allocate an order to a fulfilment center location from any other location
The script assigns the order to a location, there are no checks to decide which orders to assign
Sample Script - Allocate an order to a location
This script does the following,
1) only orders that are in Check For Split folder will be considered in this script, this is filtered in Filter query
2) the script will get availability levels for the order items, it will also exclude all orders in Check For Split folder, in order to get accurate available quantity
3) if there are enough stock to fulfil ALL items (and all the same items in all other orders),
- the order will be moved to Ready folder
4) if order can be fulfilled partially it will be split out into two orders
- the new order will be moved to Ready folder
Note: This script is using filtering to only get orders that are allocated to folder Check For Split and only those orders that have at least one or more item availablity >=0
Split into one package for each order item or order composite child item.
Sample Code - Split package single
This script does the following:
1) Sets the postcode to upper case
2) Inserts a space in the correct place
Sample Code - UK Post Code formatting
The script changes the US state name to a state code. You can add your own variations of state names and most common misspellings to the dictionary in StateReplace replace method.
Script Sample - US State name change to state code
The script check if the state of the shipping address is CA (California) and sets the tax rate to 8.5%
Sample Script - United States state Tax Recalculation
The script checks if an order is allocated to a specific fulfilment center (in this case fulfilment id "AAA1DC7C-1740-484C-B020-E95F78678931" - use Debug to find out the Id of the fulfilment center location), the script will itterate through all order items and compile an email body to be sent to a drop shipper. Then sends the email immidiatly using SMTP details specified in the SendEmailNow command.
Sample Script - Send a single email to Drop Shipper for an order
You can add code to your open order script, that will add an entry to your orders audit trail to log that the scrip was run. below is the code you will need.
using (SqlConnection conn = new SqlConnection(order.GetConnectionString))
{
conn.Open();
linnworks.finaware.CommonData.OrderData.AddOrderLifeHistory(conn, order.pkOrderID, "SCRIPT", "note", null, null);
conn.Close();
}