Customer Creation and Update

To add or update customer fields, please do the following, call the method passing a JSONArray containing a JSONObject:

Customer.assignOrUpdateValueToCustomerFields({
  fields: { "field1": "field1_value", "field2": "field2_value" }
  }, (customer) => {
		// Do something
}, (error) => {
  // Log error
})

For example:

Customer.assignOrUpdateValueToCustomerFields({
  fields: { 
"email": "[email protected]",
    "phone": "123456",
    "name": "Peter",
    "last_name": "Brice"
}
  }, (customer) => {
		// Do something
}, (error) => {
  // Log error
})

Otherwise, if you want to eliminate a field, you have to do this with an array of strings containing the name of the fields:

Customer.deleteValuesFromCustomerFields(["field1", "field2"], (customer) => {
		// Do something
}, (error) => {
		// Log error
})