Create Address
This API is used to create a new address for an user.
- application/json
Request Body required
- annotation string required
Type of address such as home or work.
- line string required
The line of the address. Typically the street address, number of the apartment, suite.
- area string required
The name of the area in the city.
- city string required
The name of the city or district.
- state string required
The region of the address, such as the province or state.
- country string required
The name of the country.
- zip string required
The zip or postal code of the address.
- landmark string
The nearest landmark to recognize the address.
- coordinates number[]
The two numbers are a location's latitude number and its longitude number.
- default boolean
Default value:
false
The default address to use.
contact object
name string requiredThe name of the user.
mobile object required
code string requiredUnique numeric country code
number string requiredThe valid phone number of the customer.
Responses
- 201
- 400
Success response
- application/json
- Example
{
"statusCode": 201,
"data": {
"annotation": "Home",
"line": "Plot No 52, Balakrishna Nagar, 1st Street, Thiruninravur",
"area": "Thiruninravur",
"city": "Chennai",
"state": "Tamil Nadu",
"country": "India",
"zip": "602024",
"landmark": "Near Kamban Park",
"coordinates": [
0,
0
],
"default": false,
"_id": "632c5839b5f554ad3047e13a"
}
}
Validation error response
- application/json
- Example
{
"statusCode": 400,
"errors": {
"annotation": [
"annotation must be a string"
],
"line": [
"line must be a string"
],
"area": [
"area must be a string"
],
"city": [
"city must be a string"
],
"state": [
"state must be a string"
],
"country": [
"country must be a string"
],
"zip": [
"zip must be a string"
],
"landmark": [
"landmark must be a string"
],
"coordinates": [
"coordinates should not be empty"
]
},
"message": "Bad Request"
}