Automate creating multiple shipments for an order with a product based criteria

Problem I am solving :

  • An e-commerce store I helped create has 3 types of products

  • An order may have 1 or more product types

  • Need to automatically split order into separate shipments based on product-type. So if only product type one is there create one shipment, If the order has product type 1 and product type 3 - Create 2 shipments

  • For each shipment create Shipping Label and a packaging Label - Criteria of shipping label - Cheapest label that is not USPS

  • Put the shipping Label, Packaging label into Google Drive at specified folders