FlowRunner
Features Pricing
Theme
Start Free

International WooCommerce orders with Shippo customs

Orders going abroad get a Shippo customs declaration built from the order lines, the cheapest label that arrives in time, and tracking sent to the customer.

The prompt

When a WooCommerce order ships to another country, create a Shippo customs item for every line using the product weight, the price and our country of origin, and put them on one customs declaration signed in my name. Create the shipment with the declaration, buy the cheapest label that arrives within 10 days, and save the label and commercial invoice links on the order. If the label goes with DHL, look up the DHL service point nearest the customer and add it to the tracking note we send them. If no label can be bought, leave a private note on the order.

FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.

The flow

No Yes Yes No Yes Yes No Repeats for each item Declare each item Code Pick the cheapestrate Condition Shipping with DHL? Action Find the nearestDHL service point Action Send tracking tothe customer Action Save the label andcustoms papers Condition Ships to anothercountry? Code Build the parcel Action Create the shipmentwith customs Condition Rate that arrives intime? Action Create the customsdeclaration Code Write the customer'snote Action Start an emptydeclaration Starts the flow New WooCommerceorder Action Flag the order fora manual label Action Buy the label If a step fails No service pointfound Condition Label bought?

Inside the loop: Declare each item

Action Get the product Code Add it to thedeclaration Action Create thecustoms item

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

  1. New WooCommerce order Starts a run the moment a new order is placed in your WooCommerce store. Only orders going outside your home country continue, and domestic orders are left for the label flow.
  2. Declare each item Goes through the order one line at a time, reads each product's weight from WooCommerce and creates a Shippo customs line with the item name, quantity, unit weight, unit price, currency, SKU and country of origin.
  3. Create the customs declaration Puts every line on one declaration for merchandise, certified in the name on your ship-from address.
  4. Create the shipment with customs Puts the order weight plus the empty box weight into a parcel the size of your standard box and creates the Shippo shipment to the customer with the declaration attached, which returns the carrier rates.
  5. Buy the label Picks the cheapest rate that arrives within your day limit and buys the label on it, tagged with the WooCommerce order ID. When no rate fits or the purchase fails, the order gets a private note, and the declaration is already in Shippo for whoever buys the label.
  6. Save the label and customs papers Leaves a private note with the carrier, price, tracking number, the label link and the commercial invoice link when the carrier issues one.
  7. Find the nearest DHL service point For labels with DHL, looks up the DHL service point closest to the customer's address. Other carriers skip this, and the run carries on if the lookup fails.
  8. Send tracking to the customer Adds a customer note with the tracking message and the nearest DHL service point when one was found, which WooCommerce emails to the buyer.

Before you turn it on

  • Enter your Shippo API token, your WooCommerce store URL, consumer key and consumer secret, and a DHL API key subscribed to Location Finder.
  • Fill in the flow setting Ship-from address. The name in it signs the customs declaration. Change Home country and Country of origin if they aren't the US.
  • Set the flow setting Box to your standard box size, the unit your product weights are in (lb, oz, kg or g), and what the empty box and packing weigh. Give each product a weight in WooCommerce.
  • The declaration goes out as merchandise, returned if undeliverable, duties paid by the customer, with the US low-value export exemption. Change those in Create the customs declaration if they don't fit how you ship.
  • Change the flow setting Most days in transit if 10 days doesn't fit your promise to customers.