I need to dynamically add a shipment and shipment track into an order, it needs to be dynamically because we will do it in batch, can you guys give me some help on this?
EDIT:
The user will see a page with a list of orders, then he will input the track number for each and submit the form, so I need to get a known carrier and send all orders via this carrier.
here you go :)
If you have a list of order ids and corresponding tracking numbers you can,
Then you can go through all the shipments and add the tracking like,
You would need to have a nested loop of order ID and tracking ID on top of this code.