My Products

Unable to empty an optional address (Billing or Delivery address) on a Customer using the API

by ReinderReinders

I believe this is a functional oversight in the implementation of the Customer/PUT API call.

If I POST a new Customer and supply only a Main Address, the optional addressses (Billing or Delivery address) will have the checkbox "same as main" marked, and the underlying address will be the same Address record (same Id property) as the main record:



If I have created an existing Billing or Delivery address and want to empty it, there is no option in the PUT API to do so.

- supplying empty strings will throw an error (country must have a value)

- supplying null will not update the address record

- supplying the same data as the main record (overwrite the Billing address with the Main address) will result in a separate address record, and "same as main" will not be checked:



This matches the functionality as it is implemented in the screen. There is no way to empty a Country, because it must always have a value:



The way to empty a country in the screen is to manually check the "same as main" checkbox, this will overwrite the entire address record:


However, the Customer/PUT API call offers no way to influence this checkbox at all, which means I cannot mirror the screen functionality using API calls. It means that I am never able to empty a Billing/Delivery address.





by Yıldırım (Updated ‎03-10-2023 12:20 by Yıldırım VISMA )

Hello,  Customer > General Information > Country is a mandatory field.  That field is automatically populated, even creating a new Customer in the UI, therefore we can not override the value with null. This is valid for all related Country fields, also not possible with on-the-fly entry. 


Thank you, the original bug report is that there is no option to pass the "same as main" parameter through the API. So I am unable to simulate the action I would do in the screen within an API call.


Hei Reinder, we'll create a case to Expose "Same as main" option for the address & contact fields via Customer Endpoint