post https://{accountName}.{environment}.com.br/api/dataentities//documents
This request allows you to create a new document corresponding to a given data entity. For example, you can create a new customer profile or address.
You can use this request to create documents for 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 create.
Example use cases
Client profile
In order to create a new customer profile, choose the CL
data entity and send a request similar to this:
POST
https://examplestore.vtexcommercestable.com.br/api/dataentities/CL/documents
Request body
{
"email": "[email protected]",
"firstName": "Clark",
"lastName": "Kent",
"phone": "+12025550195",
"documentType": "CPF",
"document": "12345678900"
"isCorporate": false,
"isNewsletterOptIn": false,
"localeDefault": "en-US"
}
Client address
For a new address, the data entity is AD
and the request would look like this:
POST
https://examplestore.vtexcommercestable.com.br/api/dataentities/AD/documents
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"
}