# \_set

Sets the details of a Customer's Address

### Parameters

#### id

The ID of the Address you wish to modify.

#### obj\_id

The ID of the Customer with said Address.

#### new

An array of parameters which overwrite current parameters in the Address with.

Fields which can be used under **new** are:

* street\_address1
* street\_address2
* town
* city
* county
* state
* country
* postcode
* latitude
* longitude

#### obj\_type

The ID of the Type of Customer with the Address.

### Example

```
FM_api('Address_set',[
  'id'=>'30180',
  'obj_id'=>683034,
  'obj_type'=>'90015'
  'new'=>[
    'street address 2'=>'TestAddressTwo',
    'postcode'=>'',
    'county'=>'tEst county',
    'country'=>'IRL'
    ]
  ]
);
```

### Results

#### On Success

```
{"ok":1}
```

#### On Failure

If the "obj\_id" parameter is not set or has a value less than 1:

```
{"error":"missing or invalid parameter: obj_id"}
```

If the "new" parameter is not set:

```
{"error":"missing or invalid parameter: new"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/address/_set.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
