Skip to content
platform

API reference · Customers · Addresses

Add Address to Customer

Method
POST
Route
/customer/:document/address
Base URL
https://ws.autorei.net
Path parameters
:document
Token
Requires Bearer token
Test in Postman

Opens this request in the public API documentation, the official source of the reference.

Description

Adds an address to the record of one of your store's customers.

Path Parameters

Parameter Type Required Description
document string Yes CPF or CNPJ of the customer.

Request Body (JSON)

Field Type Required Description
name string Yes Address name. Cannot be null.
zipcode string Yes CEP of the address. It is what resolves street and neighborhood — see the Correios rule.
number string Yes Number.
complement string No Complement.
street string Conditional Street. See the Correios rule.
quarter string Conditional Neighborhood. See the Correios rule.
city string No City.
state string No State (UF).
addressType string No RESIDENTIAL or BUSINESS. Case-insensitive.
farmerStateRegistration string No Rural producer state registration.
principal boolean No Marks the address as the main one.
howToReachLocationDescription string No Instructions for accessing the location.
responsibleContact string No Contact person at the address.
enabled boolean No Active address. When omitted, it is true.
addressAttributes array No Custom attributes. Each one must exist in your store's configuration.

Business rules

The CEP drives the address

The address is resolved by the Correios from the zipcode, and what the Correios return replaces what you sent in street, quarter, city and state. Only these survive from your payload: number and complement.

The fields you send work as a fallback: each one is used only when the Correios do not return that data for the CEP. After the merge, street and quarter cannot be empty — if they are, the address is rejected.

A CEP not found is also rejected, unless your store has CEP validation disabled.

addressType accepts only two values

RESIDENTIAL or BUSINESS, in any case. Any other value is rejected with Property addressType is type-mismatched.

Response · 200

The created address. The code is 200, not 201.

Field Type Description
id integer Address id. It is what removal requires.
name string Address name.
zipcode string CEP, formatted (04543-000).
street · number · complement string Street, number, and complement.
quarter · city · state string Neighborhood, city, and state (UF).
principal boolean Whether it is the customer's main address.
addressType string RESIDENTIAL or BUSINESS.
farmerStateRegistration string Rural producer state registration. null when there is none.
howToReachLocationDescription string Instructions for accessing the location. null when there is none.
responsibleContact string Contact person at the address. null when there is none.
attributes object Custom attributes of the address. Comes as {} when there is none.
dateCreated · lastUpdated string Creation and last change, in UTC.

Errors

Code When
400 name missing (O nome do endereço (name) não pode ser nulo), addressType outside the two values, or addressAttributes with an attribute that does not exist in your store's configuration.
404 Document not registered in your store.
401 Token missing, malformed, or expired.

Example request

curl --request POST 'https://ws.autorei.net/customer/:document/address' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Escritório",
  "zipcode": "01310-100",
  "street": "Avenida Paulista",
  "number": "2000",
  "complement": "12º andar",
  "quarter": "Bela Vista",
  "city": "São Paulo",
  "state": "SP",
  "addressType": "BUSINESS",
  "principal": false,
  "howToReachLocationDescription": "Entrada pela portaria B",
  "responsibleContact": "Marcos Aurélio"
}'

Example responses

200Success — address added

{
  "id": 4470702,
  "name": "Escritório",
  "zipcode": "01310-100",
  "street": "Avenida Paulista",
  "number": "2000",
  "complement": "12º andar",
  "quarter": "Bela Vista",
  "city": "São Paulo",
  "state": "SP",
  "principal": false,
  "addressType": "BUSINESS",
  "farmerStateRegistration": null,
  "howToReachLocationDescription": "Entrada pela portaria B",
  "responsibleContact": "Marcos Aurélio",
  "attributes": {},
  "dateCreated": "2026-09-01T13:42:07Z",
  "lastUpdated": "2026-09-01T13:42:07Z"
}

Used in

Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.