Rate-shopped Easyship label for every WooCommerce order
Each new WooCommerce order gets Easyship's cheapest courier, or the fastest when the customer chose expedited shipping, plus a label and tracking posted to Slack.
The prompt
When a new order comes in on my WooCommerce store, weigh it from the product weights plus my standard box and ask Easyship for courier rates. If the customer picked an expedited shipping method, choose the fastest courier. Otherwise choose the cheapest. Create the Easyship shipment with that courier, generate the label, and once it's ready post the order number, courier, cost and tracking number to our fulfillment channel in Slack. If no rate comes back or the label fails, tell the fulfillment channel so someone ships it by hand.
FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.
The flow
Inside the loop: Weigh each item
Inside the loop: Wait for the label
Download the file, then in FlowRunner click + beside Flows, pick it under Import a Flow Version and click Create. How importing works
What each step does
- New WooCommerce order Starts a run the moment a new order is placed in your WooCommerce store.
- Weigh each item Reads each product's weight from WooCommerce and builds the parcel's item list with quantities, prices and your Easyship item category.
- Request courier rates Sends your ship-from address, the customer's address and the parcel in your standard box to Easyship and gets back a rate from every courier that can take it.
- Pick the rate for the order An order whose shipping method reads as expedited gets the fastest courier. Every other order gets the cheapest. If Easyship returns no rate, the fulfillment channel hears about it and nothing is bought.
- Create the shipment Creates the Easyship shipment with the chosen courier and the WooCommerce order number.
- Generate the label Asks Easyship to produce the label for that courier.
- Wait for the label Checks with Easyship every 10 seconds until the label is done. A label that fails goes to the fulfillment channel with the shipment number, so someone can fix it in Easyship.
- Post tracking to fulfillment Posts the order number, the courier and why it won, the cost, the delivery days and the tracking number to Slack.
Before you turn it on
- Enter your Easyship API token, and your WooCommerce store URL, consumer key and consumer secret.
- Connect your Slack account and pick your fulfillment channel in the three Slack steps.
- Fill in the flow setting Ship-from address. Set Box to your standard box in centimeters and what the empty box weighs in kilograms, and Store weight unit to the unit your products use. Give each product a weight in WooCommerce, since the flow weighs orders from them.
- Set Item category to the Easyship category that fits what you sell, and change Expedited shipping methods to words from your own expedited method names.