Client Data Changes

There are several API endpoints for updating client data. In this section, we will look at only the most commonly used ones.

For the others, please see the /api/v1/users endpoint.

Attention

When updating client data, if you pass a NULL value, the previous value will be replaced with NULL.

Changing all

The following example shows how to change the client data:

								
  var clientUpdateInputModel = new
  {
	Name = name,
	Surname = surname,
	Email = email,
	PhoneNumberPrefix = phoneNumberPrefix,
	PhoneNumberNumber = phoneNumberNumber,
	BirthDate = birthDate,
	CivilStatusId = civilStatusId,
	CivilStatusDate = civilStatusDate,
	GenderId = genderId,
	LanguageId = languageId,
	Nationality1Id = nationalityId,
	DeliverTaxStatement = deliverTaxStatement,
	TaxLiabilityId = taxLiaabilityId,
	WorkSituationId = workSituationId,
	PensionSituationId = pensionSituationId
  };

  var userId = 226;
  var clientUpdateInputModelAsString = JsonConvert.SerializeObject(clientUpdateInputModel);
  _ = await httpClient.PutAsync($"api/v1/users/user-id/{userId}", new StringContent(clientUpdateInputModelAsString, Encoding.UTF8, "application/json"));
									

Changing address

The following example shows how to change the client’s address:

								
  var userAddressInputModel = new
  {
	Street = street,
	StreetNr = streetNr,
	City = city,
	CountryId = countryId,
	Zip = zip
  };

  var userId = 226;
  var userAddressInputModelAsString = JsonConvert.SerializeObject(userAddressInputModel);
  _ = httpClient.PutAsync($"api/v1/users/update-address/user-id/{userId}", new StringContent(userAddressInputModelAsString, Encoding.UTF8, "application/json")).Result;