I’m under the impression that when creating/updating a contact, when region (state) is specified, country code must be specified.
Nevertheless, I have contact with State, but no country code in the billing address.
How is this possible?
Hi @Jeffrey_Chimene, we’re currently investigating some inconsistency issues with address handling in v2, and this is listed in our known issues tracker.
I’ll give you an update as soon as it’s resolved.
There is a thread in the forum:Rest V1 Create or Update End Point: "BILLING Region is invalid" Bug?
Hi Omar,
I am not sure if changes were made recently here to REST v2, but we noticed that updating a contact’s address is removing data if it is not passed.
For instance, a contact has an address of:
field: "BILLING"
line1: “54321 Main St”
line2: ““
locality: “Phoenix”
region: “Arizona”
region_code: “US-AZ”
postal_code: “85111”
zip_code: “85111”
country: “United States”
country_code: “USA”
We want to update the line1 field of the “BILLING” address, so our update object looks like:
{“addresses”: [{“field”: ”BILLING”, “line1”: “123 Main St”}]}. The contact’s billing address is:
field: "BILLING"
line1: “123 Main St”
line2: ““
locality: “”
region: “”
region_code: “”
postal_code: “”
zip_code: “”
country: “”
country_code: “”
Is this the desired behavior?
I did notice this on the API docs for updating a contact’s address field:
Array of objects
Any address not listed here will be removed if it already exists. If an empty array is specified, all existing values will be removed.
Any address not listed here will be removed if it already exists - This makes it sounds like if we pass {"addresses":[{"field":"BILLING"...}]} and we don’t pass in a “SHIPPING” address, it would be deleted if it exists. This is NOT the case (thankfully).
Maybe this was meant to say “Any address field not listed here will be removed if it already exists”? It fits the current design pattern.
If this is the case, and this aspect of updating a contact’s address is all working as expected, this is a definite breaking change from XML and from V1. It requires us to load a contact with their addresses before making any update call involving a component of their address.
Hi @Timothy_Withers! Per RFC 7396, the expected behavior would be to replace the entire array with whatever you send. It looks like that’s not happening right now, so I’ll bring it up with the team.
Changing it to work exactly that way would unfortunately break existing v2 integrations, so it’s unlikely we’ll adjust it for v2. but I’ll make sure the team is aware.