service/LicenseService.php
public static function create(Context $context, $licenseeNumber, $licenseTemplateNumber, $transactionNumber = null, License $license)
    {
        CheckUtils::paramNotEmpty($licenseeNumber, Constants::LICENSEE_NUMBER);
        CheckUtils::paramNotEmpty($licenseTemplateNumber, Constants::LICENSE_TEMPLATE_NUMBER);

        $license->setProperty(Constants::LICENSEE_NUMBER, $licenseeNumber);
        $license->setProperty(Constants::LICENSE_TEMPLATE_NUMBER, $licenseTemplateNumber);

        if ($transactionNumber) $license->setProperty(Constants::TRANSACTION_NUMBER, $transactionNumber);

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

        $createdLicense = null;

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

        return $createdLicense;
    }
public static function create(Context $context, $licenseeNumber, $licenseTemplateNumber, $transactionNumber = null, License $license)
    {
        CheckUtils::paramNotEmpty($licenseeNumber, Constants::LICENSEE_NUMBER);
        CheckUtils::paramNotEmpty($licenseTemplateNumber, Constants::LICENSE_TEMPLATE_NUMBER);

        $license->setProperty(Constants::LICENSEE_NUMBER, $licenseeNumber);
        $license->setProperty(Constants::LICENSE_TEMPLATE_NUMBER, $licenseTemplateNumber);

        if ($transactionNumber) $license->setProperty(Constants::TRANSACTION_NUMBER, $transactionNumber);

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

        $createdLicense = null;

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

        return $createdLicense;
    }
Creates new license object with given properties.See NetLicensingAPI for details:
https://www.labs64.de/confluence/display/NLICPUB/License+Services#LicenseServices-Createlicense

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

parent licensee to which the new license is to be added
@param $licenseeNumber

license template that the license is created from
@param $licenseTemplateNumber

For privileged logins specifies transaction for the license creation. For regular logins new
transaction always created implicitly, and the operation will be in a separate transaction.
Transaction is generated with the provided transactionNumber, or, if transactionNumber is null, with
auto-generated number.
@param null|string $transactionNumber

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 License $license

@return License|null
@throws MalformedArgumentsException
@throws RestException
@throws \ErrorException