_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"}

Last updated