Model

The address model has the following endpoints:

Action

Method

Resource

Description

Get all

GET

/users/:user_id/addresses

Get all user addresses with user_id.

Get

GET

/users/user_id/addresses/address_id

Get user address with id user_id and address_id.

Create

POST

/users:user_id/addresses

Create a user address with user_id.

Update

PUT

/users/user_id/addresses/address_id

Update user address with id user_id and address_id.

Delete

DELETE

/users/user_id/addresses/address_id

Delete user address with id user_id and address_id.

The address model is composed of the following attributes:

Attribute

Type

Required

Description

name

string

no, required to create.

The user's first and/or middle name.

lastname

string

no, required to create.

The user's last name.

phone

string

no

The user's phone, minimum 7 characteres.

cellphone

string

no

The user's cellphone, minimum 10 characteres.

address

string

no

The user's address.

address_notes

string

no

The user's address notes. (e.g "Second floor")

zipcode

string

no

The user's zip code/postal code.

location

string

no

String with json format with the user's position. (e.g. "{"lat": 10.1234, "lng": 20.5678}").

default

boolean

no

If the address is default or not.

internal_number

string

no

This number is used to identify more specifically the address, such as house / apartment / room number.

tag

string

no

is a name identifier of the address

📘

About Name and Phone

This is used to add addresses that are sent to another person and the business or driver can have direct contact with them.