Update Customer
This functionality is advanced. We recommend that most users utilize the ready made modules to simplify and speed up development. The customer related modules can be found here.
updateCustomer({...}) This method updates the current customer in Buddi.
Params:
{
first_name: '',
last_name: '',
email: '',
birthday: '',
phone: '',
order_confirmation_by: '' //mail or sms
}
Example:
Buddi.updateCustomer({
first_name: JohnUpdated',
last_name: 'Doe',
email: 'john@doe.com',
birthday: '1991-01-01',
order_confirmation_by: 'sms'
});
Events: customer:profile-updated, customer:profile-updating-error, customer:updated
Returns:
{
birthday: "1991-01-01",
email: "john@doe.com",
first_name: "JohnUpdated",
full_name: "JohnUpdated Doe",
id: 147549,
last_name: "Doe",
order_confirmation_by: "sms",
phone: null
}