Update one stock field at a time.

Parameters

id

Integer. ID of the stock item to update

field

String. The name of the field to be updated. Allowed fields:

  • "name"
  • "code"
  • "is_archived"
  • "amt_trigger"

val

String. The new value of the field being updated.

Example

FM_api('Stock_updateOneField',
	[
		'id'=>'1',
		'field'=>'name',
		'val'=>'Test Item'
	]
);

Result

{"ok":1}

Errors

If you provide an invalid field name, you will receive an error:

{"error":"invalid field: xyz"}

If you provide an invalid or incorrectly formatted email address as part of the value of the amt_trigger field, you will receive an error:

{"error":"invalid email address: potato"}