# Addresses

# Create Address Endpoint

## Structure

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td><td>**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id for the address</td><td>No</td></tr><tr><td>`name`</td><td>string</td><td>The name of the address</td><td>No</td></tr><tr><td>`first_name`</td><td>string</td><td>The first name for the address</td><td>Yes</td></tr><tr><td>`last_name`</td><td>string</td><td>The last name for the address</td><td>Yes</td></tr><tr><td>`company`</td><td>string</td><td>The company for the address</td><td>No</td></tr><tr><td>`mobile`</td><td>string</td><td>The mobile number for the address</td><td>No</td></tr><tr><td>`phone`</td><td>string</td><td>The phone number for the address</td><td>No</td></tr><tr><td>`line_1`</td><td>string</td><td>The first line for the address</td><td>Yes</td></tr><tr><td>`line_2`</td><td>string</td><td>The second line for the address</td><td>No</td></tr><tr><td>`city`</td><td>string</td><td>The city for the address</td><td>Yes</td></tr><tr><td>`county`</td><td>string</td><td>The county for the address</td><td>No</td></tr><tr><td>`zone`</td><td>string</td><td>The zone code for the address, required for some countries (e.g., US, AU, etc)</td><td>Conditional</td></tr><tr><td>`postcode`</td><td>string</td><td>The postcode for the address, required for some countries (e.g., GB, US, etc)</td><td>Conditional</td></tr><tr><td>`country`</td><td>string</td><td>The country code for the address</td><td>Yes</td></tr><tr><td>`reference`</td><td>string</td><td>The **unique** reference for the address</td><td>No</td></tr><tr><td>`eori_number`</td><td>string</td><td>The EORI number for the address</td><td>No</td></tr><tr><td>`is_default`</td><td>boolean</td><td>Whether the address is default</td><td>No</td></tr></tbody></table>

## Example Request

```
POST /api/customers/{id}/addresses
```

```json
{
    "name": "API Address",
    "first_name": "test",
    "last_name": "test",
    "company": "test",
    "mobile": null,
    "phone": null,
    "line_1": "test",
    "line_2": null,
    "city": "test",
    "county": "Test",
    "zone": null,
    "postcode": "te57 10l",
    "country": "GB",
    "reference": null,
    "eori_number": null,
    "is_default": true
}
```

## Example Response

```json
{
    "address": {
        "id": 1
    }
}
```

# Update Address Endpoint

## Structure

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`id`</td><td style="height: 29.7969px;">int</td><td style="height: 29.7969px;">The id for the address</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`name`</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The name of the address</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`first_name`</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The first name for the address</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`last_name`</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The last name for the address</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`company`</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The company for the address</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`mobile`</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The mobile number for the address</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`phone`</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The phone number for the address</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`line_1`</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The first line for the address</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`line_2`</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The second line for the address</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`city`</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The city for the address</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`county`</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The county for the address</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 63.3906px;"><td style="height: 63.3906px;">`zone`</td><td style="height: 63.3906px;">string</td><td style="height: 63.3906px;">The zone code for the address, required for some countries (e.g., US, AU, etc)</td><td style="height: 63.3906px;">No</td></tr><tr style="height: 63.3906px;"><td style="height: 63.3906px;">`postcode`</td><td style="height: 63.3906px;">string</td><td style="height: 63.3906px;">The postcode for the address, required for some countries (e.g., GB, US, etc)</td><td style="height: 63.3906px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`country`</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The country code for the address</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`reference`</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The **unique** reference for the address</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`eori_number`</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The EORI number for the address</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`is_default`</td><td style="height: 46.5938px;">boolean</td><td style="height: 46.5938px;">Whether the address is default</td><td style="height: 46.5938px;">No</td></tr></tbody></table>

## Example Request

```
PUT /api/customers/{id}/addresses/{id}
```

```json
{
    "name": "API Address Updated",
    "first_name": "test2",
    "county": "Test 2"
}
```

## Example Response

```json
{
    "address": {
        "id": 1
    }
}
```

# Delete Address Endpoint

## Example Request

```
DELETE /api/customers/{id}/addresses/{id}
```

## Example Response

```
204 No Content
```