Hi
I am trying to update the value for the delivery method in the API CheckoutController in the PlaceOrder() method. I need to remove the delivery costs based on some settings on the channel.
I tried something like this
var delivery = orderCarrier.Deliveries.Where(x => x.DeliveryMethodID == Guid.Parse(deliveryMethodId)).FirstOrDefault();
var payload = new DeliveryPayloadInfo
{
DeliveryCost = 0,
DeliveryCostWithVAT = 0,
DeliveryVatPercentage = 0,
DeliveryMethodId = delivery.DeliveryMethodID,
DeliveryAddress = delivery.Address,
};
_moduleECommerce.CheckoutFlow.EditDelivery(orderCarrier, delivery.DeliveryMethodID, payload, _moduleECommerce.AdminToken);
But I get this error:
System.ArgumentException: ‘Delivery ID is not found in order.
Parameter name: deliveryCarrierIdToEdit’.
I checked and the orderCarrier has a delivery method that has a DeliveryMethodId.
What can I do to solve this issue?
Litium version: [7.3.3]