orders->get('ord_8wmqcHMN4U'); $shipment = $order->getShipment("shp_3wmsgCJN4U"); $shipment->tracking = [ 'carrier' => 'PostNL', 'code' => '3SKABA000000000', 'url' => 'http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1016EE&D=NL&T=C', ]; $shipment = $shipment->update(); echo 'Shipment with ID ' . $shipment->id. ' for order with ID ' . $order->id . '.'; echo 'Tracking information updated:'; echo 'Carrier: ' . $shipment->tracking->carrier; echo 'Code: ' . $shipment->tracking->code; echo 'Url: ' . $shipment->tracking->url; foreach ($shipment->lines as $line) { echo $line->name . ' - status: ' . $line->status . '.'; } } catch (\Mollie\Api\Exceptions\ApiException $e) { echo "API call failed: " . htmlspecialchars($e->getMessage()); }