Addresses
Manage addresses associated to contacts.
Create an address
Create an address associated to a contact
HTTP Request
POST/contacts/{contact_id}/addresses
Parameters
Name | Type | Description |
---|---|---|
street | String / Required | Street / Address |
city | String / Optional | City / Population |
postal_code | String / Optional | Postal code |
province | String / Optional | Province / State |
country | String / Required | Country code Codes available in data.options.countries of the endpoint: /info. |
default | Boolean / Optional / true, false (If not sent will be `false` by default) | Set as default address |
receptor | String / Optional | Receptor |
Playload
{
"street": "My street nº99 - 2ºA",
"country": "ES"
}
201Response
{
"data": {
"id": 60,
"receptor": "",
"street": "My street nº99 - 2ºA",
"city": "",
"postal_code": "",
"province": "",
"country": "ES",
"default": false,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
List addresses
This endpoint allows the consultation of addresses of a contact.
HTTP Request
GET/contacts/{contact_id}/addresses
200 Response
{
"data": [
{
"id": 65,
"receptor": "John Doe",
"street": "My street nº99 - 2ºA",
"city": "Madrid",
"postal_code": "28080",
"province": "Madrid",
"country": "ES",
"default": true,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
{
"id": 60,
"receptor": "",
"street": "My street nº99 - 2ºA",
"city": "",
"postal_code": "",
"province": "",
"country": "ES",
"default": false,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
]
}
Get an address
This endpoint allows the consultation of an address of a contact.
HTTP Request
GET/contacts/{contact_id}/addresses/{address_id}
200 Response
{
"data": {
"id": 65,
"receptor": "John Doe",
"street": "My street nº99 - 2ºA",
"city": "Madrid",
"postal_code": "28080",
"province": "Madrid",
"country": "ES",
"default": true,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
Update an address
This endpoint allows the update of an address of a contact.
HTTP Request
PATCH/contacts/{contact_id}/addresses/{address_id}
Parameters
Name | Type | Description |
---|---|---|
street | String / Optional | Street / Address |
city | String / Optional | City / Population |
postal_code | String / Optional | Postal code |
province | String / Optional | Province / State |
country | String / Optional | Country code Codes available in data.options.countries of the endpoint: /info. |
default | Boolean / Optional / true, false | Set as default address |
receptor | String / Optional | Receptor |
All parameters are optional but at least one parameter with value must be sent.
Playload
{
"receptor": "Mary Doe",
"default": false
}
204 Response
Response without body.
Delete an address
This endpoint allows the deletion of an address of a contact.
HTTP Request
DELETE/contacts/{contact_id}/addresses/{address_id}
204 Response
Response without body.