# \_save

Saves changes made to a Customer Type

### Parameters

#### id

The ID of the Customer type

#### name

The name of the modified Customer type

#### colour\_hex

The set background color of the Customer type

#### allowed\_next

If a customer is assigned to a specific customer type (for example "quoted"), then you may want to limit which customer types the customer can be changed to afterwards (for example, "invoiced" or "cancelled"). This parameter is a comma-delimited list of customer type IDs.

#### triggers

```
[{
    "template":"32017",
    "target":"customer",
    "replyto":"sender-test99999999@gmail.com",
    "subject":"Purchase"
}]
```

Contains an array of entries relating to emails which are sent using an Email Template:\
The ID of the template, the target of the email, a reply-to (who the email will claim to be from), and a subject for the email

### Example

```
FM_api('CustomerType_save',[
  'id'=>'60022',
  'name'=>'Residential',
  'colour_hex'=>'#ffffff',
  'allowed_next'=>'60021'
  ]
);
```

### Results

#### On Success

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

#### On Failure

If there's no 'id' parameter provided

```
{"error":"no id supplied"}
```

If there's no 'name' parameter provided

```
{"error":"no name supplied"}
```

If non-numeric characters are included in the 'allowed\_next' parameter, e.g letters

```
{"error":"values in allowed_next must be numeric"}
```


---

# 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/customertype/_save.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.
