put https://{accountName}.{environment}.com.br/api/dataentities//documents/
Update an existing document corresponding to a given data entity. For example, you can update a customer profile or address.
You can use this request to update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update.
Example use cases
Client profile
In order to update an existing customer profile, choose the CL
data entity and send a request similar to this:
PUT
https://examplestore.vtexcommercestable.com.br/api/dataentities/CL/documents/123456789abc
Request body
{
"email": "[email protected]",
"firstName": "Clark",
"lastName": "Kent",
"phone": "+12025550195",
"documentType": "CPF",
"document": "12345678900"
"isCorporate": false,
"isNewsletterOptIn": false,
"localeDefault": "en-US"
}
Client address
To update an address, the data entity is AD
and the request would look like this:
PUT
https://examplestore.vtexcommercestable.com.br/api/dataentities/AD/documents/123456789abc
Request body
{
"addressName": "My House",
"addressType": "residential",
"city": "Metropolis",
"complement": "",
"country": "USA",
"postalCode": "11375",
"receiverName": "Clark Kent",
"reference": null,
"state": "MP",
"street": "Baker Street",
"neighborhood": "Upper east side",
"number": "21",
"userId": "7e03m794-a33a-11e9-84rt6-0adfa64s5a8e"
}