HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/debout/debout.nl/vendor/mollie/mollie-api-php/examples/shipments/get-shipment.php
<?php
/*
 * Retrieve a shipment using the Mollie API.
 */

try {
    /*
     * Initialize the Mollie API library with your API key or OAuth access token.
     */
    require "../initialize.php";

    /*
     * Retrieve a shipment with ID "shp_3wmsgCJN4U" for the order with ID "ord_8wmqcHMN4U".
     *
     * See: https://docs.mollie.com/reference/v2/shipments-api/get-shipment
     */

    $order = $mollie->orders->get('ord_8wmqcHMN4U');
    $shipment = $order->getShipment("shp_3wmsgCJN4U");

    echo 'Shipment with ID ' . $shipment->id. ' for order with ID ' . $order->id . '.';
    foreach ($shipment->lines as $line) {
        echo $line->name . ' - status: <b>' . $line->status . '</b>.';
    }
} catch (\Mollie\Api\Exceptions\ApiException $e) {
    echo "API call failed: " . htmlspecialchars($e->getMessage());
}