# Update an Address
source: https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/data-management/update-address/index.md

## Test case -- Success -- Update additional Address for a Client {#test-case--success--update-additional-address-for-a-client}

This test case describes updating an address for a specified client in the CMS.

For this test case, use the following information in the request:

| Path parameter | Available value |
|----------------|-----------------|
| `address_type` | PIN             |
|                | STMT            |

**Sample request**

`PUT /clients/40000/addresses/PIN`

```JSON
{
  "enabled": true,
  "addressLine1": "Mrs. Alice Smith Apartment",
  "addressLine2": "1c 213",
  "addressLine3": "Derrick Street",
  "addressLine4": "2nd floor",
  "city": "Boston",
  "country": "USA",
  "email": "johndoe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "postalCode": "02130",
  "state": "MA"
}
```

**Sample response**

`204`

## Test case -- Fail -- Update additional Address for a Client -- invalid address type {#test-case--fail--update-additional-address-for-a-client--invalid-address-type}

This test case describes an attempt to update an address for a specified client in the CMS when the `address_type` in the request is invalid.

For this test case, use the following information in the request:

| Path parameter | Available value |
|----------------|-----------------|
| `address_type` | INVALID         |

**Sample request**

`PUT /clients/40000/addresses/INVALID`

```JSON
{
  "enabled": true,
  "addressLine1": "Mrs. Alice Smith Apartment",
  "addressLine2": "1c 213",
  "addressLine3": "Derrick Street",
  "addressLine4": "2nd floor",
  "city": "Boston",
  "country": "USA",
  "email": "johndoe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "postalCode": "02130",
  "state": "MA"
}
```

**Sample response**

`404`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "ADDRESS_TYPE_DOES_NOT_EXIST",
        "Description": "Address type INVALID not found.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Fail -- Update additional Address for a Client -- disabling already disabled address {#test-case--fail--update-additional-address-for-a-client--disabling-already-disabled-address}

This test case describes an attempt to disable an address for a specified client in the CMS when a specified address type has disabled status in the CMS.

For this test case, use the following information in the request:

| Path parameter | Available value |
|----------------|-----------------|
| `address_type` | PIN             |
|                | STMT            |

|   Field   | Available value |
|-----------|-----------------|
| `enabled` | null            |

**Sample request**

`PUT /clients/40000/addresses/PIN`

```JSON
 {
  "enabled": null,
  "addressLine1": "Mrs. Alice Smith Apartment",
  "addressLine2": "1c 213",
  "addressLine3": "Derrick Street",
  "addressLine4": "2nd floor",
  "city": "Boston",
  "country": "USA",
  "email": "johndoe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "postalCode": "02130",
  "state": "MA"
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "ADDRESS_TYPE_ALREADY_DISABLED",
                "Description": "Address type PIN is already disabled.",
                "Recoverable": false
            }
        ]
    }
}
```

## Test case -- Success -- Update an Address for a Contract {#test-case--success--update-an-address-for-a-contract}

This test case describes updating an address for a specified contract (account contract or card contract) in the CMS.

For this test case, use the following information in the request:

| Path parameter | Available value |
|----------------|-----------------|
| `address_type` | PIN             |
|                | STMT            |

**Sample request**

`PUT /contracts/70001/addresses/PIN`

```JSON
{
  "enabled": true,
  "addressLine1": "Mrs. Alice Smith Apartment",
  "addressLine2": "1c 213",
  "addressLine3": "Derrick Street",
  "addressLine4": "2nd floor",
  "city": "Boston",
  "country": "USA",
  "email": "johndoe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "postalCode": "02130",
  "state": "MA"
}
```

**Sample response**

`204`

## Test case -- Fail -- Update an Address for a Contract -- invalid address type {#test-case--fail--update-an-address-for-a-contract--invalid-address-type}

This test case describes an attempt to update an address for a specified contract (account contract or card contract) in the CMS when the `address_type` in the request is invalid.

For this test case, use the following information in the request:

| Path parameter | Available value |
|----------------|-----------------|
| `address_type` | INVALID         |

**Sample request**

`PUT /contracts/70001/addresses/INVALID`

```JSON
{
  "enabled": true,
  "addressLine1": "Mrs. Alice Smith Apartment",
  "addressLine2": "1c 213",
  "addressLine3": "Derrick Street",
  "addressLine4": "2nd floor",
  "city": "Boston",
  "country": "USA",
  "email": "johndoe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "postalCode": "02130",
  "state": "MA"
}
```

**Sample response**

`404`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "ADDRESS_TYPE_DOES_NOT_EXIST",
        "Description": "Address type INVALID not found."
        "Recoverable": false,
      }
    ]
  }
}
```

## Test case -- Fail -- Update an Address for a Contract -- disabling already disabled address {#test-case--fail--update-an-address-for-a-contract--disabling-already-disabled-address}

This test case describes an attempt to disable an address for a specified contract (account contract or card contract) when the `address_type` already has disabled status in the CMS.

For this test case, use the following information in the request:

| Path parameter | Available value |
|----------------|-----------------|
| `address_type` | PIN             |
|                | STMT            |

|   Field   | Available value |
|-----------|-----------------|
| `enabled` | null            |

**Sample request**

`PUT /contracts/70001/addresses/PIN`

```JSON
{
  "enabled": null,
  "addressLine1": "Mrs. Alice Smith Apartment",
  "addressLine2": "1c 213",
  "addressLine3": "Derrick Street",
  "addressLine4": "2nd floor",
  "city": "Boston",
  "country": "USA",
  "email": "johndoe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "postalCode": "02130",
  "state": "MA"
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "ADDRESS_TYPE_ALREADY_DISABLED",
                "Description": "Address type PIN is already disabled.",
                "Recoverable": false
            }
        ]
    }
}
```

