service/TokenService.php
public static function create(Context $context, Token $token)
    {
        $response = NetLicensingService::getInstance()
            ->post($context, Constants::TOKEN_ENDPOINT_PATH, $token->asPropertiesMap());

        $createdToken = null;

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

        return $createdToken;
    }
public static function create(Context $context, Token $token)
    {
        $response = NetLicensingService::getInstance()
            ->post($context, Constants::TOKEN_ENDPOINT_PATH, $token->asPropertiesMap());

        $createdToken = null;

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

        return $createdToken;
    }
Creates new token.See NetLicensingAPI for details:
https://www.labs64.de/confluence/display/NLICPUB/Token+Services#TokenServices-Createtoken

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

non-null properties will be updated to the provided values, null properties will stay unchanged.
@param Token $token

return created token
@return Token|null
@throws \ErrorException
@throws RestException