diff --git a/src/Client.php b/src/Client.php index c995786..e8d6a13 100644 --- a/src/Client.php +++ b/src/Client.php @@ -165,6 +165,8 @@ public function createParcel( ?ShippingMethod $shippingMethod = null, ?string $errors = null, ?string $shippingMethodCheckoutName = null, + ?string $totalOrderValue = null, + ?string $totalOrderValueCurrency = null, ): Parcel { $parcelData = $this->createParcelData( shippingAddress: $shippingAddress, @@ -177,6 +179,8 @@ public function createParcel( items: $items, postNumber: $postNumber, shippingMethodCheckoutName: $shippingMethodCheckoutName, + totalOrderValue: $totalOrderValue, + totalOrderValueCurrency: $totalOrderValueCurrency, ); try { @@ -567,6 +571,8 @@ protected function createParcelData( ?string $postNumber = null, bool $applyShippingRules = false, ?string $shippingMethodCheckoutName = null, + ?string $totalOrderValue = null, + ?string $totalOrderValueCurrency = null, ): array { $parcelData = []; @@ -664,6 +670,11 @@ protected function createParcelData( $parcelData['shipping_method_checkout_name'] = $shippingMethodCheckoutName; } + if ($totalOrderValue && $totalOrderValueCurrency) { + $parcelData['total_order_value'] = $totalOrderValue; + $parcelData['total_order_value_currency'] = $totalOrderValueCurrency; + } + // Additional fields are only added when requesting a label if ($requestLabel) { $parcelData['request_label'] = true;