code: @Transactional
  	public void register(Subscription subscription) {
  		Endpoint versionsEndpoint = subscription.getEndpoint(ModuleIdentifier.VERSIONS);
  		if (versionsEndpoint == null) {
  			return;
  		}
  
  		LOG.info("Registering, get versions from endpoint " + versionsEndpoint.getUrl());
  		Version version = findHighestMutualVersion(
  				getVersions(versionsEndpoint.getUrl(), subscription.getPartnerAuthorizationToken()));
  
  		LOG.info("Registering, get versiondetails at " + version.url);
  		VersionDetails versionDetails = getVersionDetails(version.url, subscription.getPartnerAuthorizationToken());
  		// store version and endpoints for this subscription
  		subscription.setOcpiVersion(version.version);
  
  		for (io.motown.ocpi.dto.Endpoint endpoint : versionDetails.endpoints) {
  
  			subscription.addToEndpoints(new Endpoint(endpoint.identifier, endpoint.url.toString()));
  			// because the endpoints in 'versionInformationResponse' are not
  			// DTO's (yet) we must instantiate ModuleIdentifier from value
  		}
  
  		// if not present generate a new token
  		if (subscription.getAuthorizationToken() == null) {
  			subscription.generateNewAuthorizationToken();
  		}
  		ocpiRepository.insertOrUpdate(subscription);
  
  		Credentials credentials = postCredentials(subscription);
  		if (credentials.token != null) { // if no token update do not overwrite
  			// existing partner token!
  			LOG.debug("Updating partnerToken with: " + credentials.token);
  			subscription.setPartnerAuthorizationToken(credentials.token);
  			// at this point we can safely remove the versionsEndpoint
  			LOG.info("REMOVING VERIONS-ENDPOINT");
  			subscription.getEndpoints().remove(versionsEndpoint);
  
  			ocpiRepository.insertOrUpdate(subscription);
  		}
  	}
docs: registers with the EMSP with passed as argument the endpoints of this
  EMSP are stored in the database, as well as the definitive token
  
  @param tokenProvider