$service = \Bitrix\Sale\Delivery\Services\Manager::getById($deliveryId);
$deliveryData = [
'DELIVERY_ID' => $service['ID'],
'DELIVERY_NAME' => $service['NAME'],
'ALLOW_DELIVERY' => 'Y',
'PRICE_DELIVERY' => $deliveryPrice,
'CUSTOM_PRICE_DELIVERY' => 'Y'
];
$shipment->setFields($deliveryData);