service/ProductModuleService.php
public static function create(Context $context, $productNumber, ProductModule $productModule)
    {
        CheckUtils::paramNotEmpty($productNumber, Constants::PRODUCT_NUMBER);

        $productModule->setProperty(Constants::PRODUCT_NUMBER, $productNumber);

        $response = NetLicensingService::getInstance()
            ->post($context, Constants::PRODUCT_MODULE_ENDPOINT_PATH, $productModule->asPropertiesMap());

        $createdProductModule = null;

        if (!empty($response->items->item[0])) {
            $createdProductModule = ItemToProductModuleConverter::convert($response->items->item[0]);
            $createdProductModule->exists = true;
        }

        return $createdProductModule;
    }
public static function create(Context $context, $productNumber, ProductModule $productModule)
    {
        CheckUtils::paramNotEmpty($productNumber, Constants::PRODUCT_NUMBER);

        $productModule->setProperty(Constants::PRODUCT_NUMBER, $productNumber);

        $response = NetLicensingService::getInstance()
            ->post($context, Constants::PRODUCT_MODULE_ENDPOINT_PATH, $productModule->asPropertiesMap());

        $createdProductModule = null;

        if (!empty($response->items->item[0])) {
            $createdProductModule = ItemToProductModuleConverter::convert($response->items->item[0]);
            $createdProductModule->exists = true;
        }

        return $createdProductModule;
    }
Creates new product module object with given properties.See NetLicensingAPI for details:
https://www.labs64.de/confluence/display/NLICPUB/Product+Module+Services#ProductModuleServices-Createproductmodule

determines the vendor on whose behalf the call is performed
@param Context $context

parent product to which the new product module is to be added
@param string $productNumber

non-null properties will be taken for the new object, null properties will either stay null, or will
be set to a default value, depending on property.
@param ProductModule $productModule

the newly created product module object
@return ProductModule|null
@throws MalformedArgumentsException
@throws RestException
@throws \ErrorException