updateCustomerInfo( )


Updates the customer's information for a booking.

The updateCustomerInfo() function returns a Promise that resolves to a Booking object when the specified customer's information has been updated.

Notes:

  • The whole formInfo object is updated for each request. Values for properties that are not included in the request will therefore be deleted.
  • updateCustomerInfo() does not update the information for the corresponding contact or member. To update contacts or members use updateContact().
  • Only users with Bookings Admin permissions can update customer information for a booking. You can override the permissions by setting the suppressAuth options to true.
Method Declaration
Copy
function updateCustomerInfo(
  bookingId: string,
  formInfo: FormInfo,
  options: Options,
): Promise<Booking>;
Method Parameters
bookingIdstringRequired

ID of the booking to be updated.


formInfoFormInfoRequired

Updated form info and contact details.


optionsOptions

An object representing the available options for updating customer information.

Returns
Return Type:Promise<Booking>
Update customer information
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { bookings } from "wix-bookings-backend"; export const updateCustomerInfo = webMethod(Permissions.Anyone, async () => { const bookingId = "0b535e5c-5d30-493c-bd5e-ef92ba6503b7"; const formInfo = { contactDetails: { firstName: "Fred", lastName: "Thompson", email: "fred@thompson.com", phone: "5558707", }, paymentSelection: [ { rateLabel: "General", numberOfParticipants: 3, }, ], additionalFields: [ { value: "A Message from Fred", _id: "00000000-0000-0000-0000-000000000008", }, ], }; return bookings .updateCustomerInfo(bookingId, formInfo) .then((booking) => { return booking; }) .catch((error) => { return error; }); }); /* Returns a promise that resolves to a booking object: * * { * "_id": "0b535e5c-5d30-493c-bd5e-ef92ba6503b7", * "bookedEntity": { * "serviceId": "b71df756-309f-468e-aec2-f82b9a9a9441", * "scheduleId": "53616b1f-0c3c-45a1-b282-675acd248179", * "singleSession": { * "sessionId": "193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1HunZjEPUQ0IeScw cTFJNXEmLG2g6Q8tvUJQZrPhU6XKhVrlLZraC3YcVfygADFiCPyyy5IVhgtDpF30FnQDoG8I60n21QAlhok4 LHNlkBszoGZ67jGMeDOqxS8PXZgJx87ByXwfgsN3AfXbndYxESrFnttLnRSFzcsolOnBRWHQAvTO0Tm0lEZ2 wIkEAlBrLj6aximrsee44236Oi5bWmdlEdc6fgZ8rfy8bmNsGyV8ryxoDEs8OrU3KHtZEnocCDS1rwZBU2n", * "start": "2021-01-15T17:30:00Z", * "end": "2021-01-15T18:00:00Z" * }, * "title": "Yoga Class", * "location": { * "locationType": "OWNER_BUSINESS" * }, * "rate": { * "labeledPriceOptions": { * "general": { * "amount": "50", * "currency": "USD", * "downPayAmount": "0" * } * } * }, * "tags": [ * "GROUP" * ] * }, * "bookedResources": [ * { * "id": "76570209-101f-409b-af97-b445bdb63125", * "name": "John Smith", * "email": "jsmith@gmail.com", * "_id": "76570209-101f-409b-af97-b445bdb63125" * } * ], * "status": "CONFIRMED", * "bookingSource": { * "platform": "WEB", * "actor": "CUSTOMER", * "appDefId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97", * "appName": "Wix Bookings" * }, * "_createdDate": "2021-01-13T17:51:21.566Z", * "formInfo": { * "paymentSelection": [ * { * "rateLabel": "general", * "numberOfParticipants": 3 * } * ], * "additionalFields": [ * { * "_id": "00000000-0000-0000-0000-000000000008", * "label": "Add Your Message", * "value": "A Message from Fred", * "valueType": "LONG_TEXT", * } * ], * "contactDetails": { * "contactId": "b5d03d59-f4b9-49e5-95e2-864b33f30049", * "firstName": "Fred", * "lastName": "Thompson", * "email": "fred@thompson.com", * "phone": "5558707" * } * }, * "paymentDetails": { * "balance": { * "finalPrice": { * "amount": "50", * "currency": "USD", * "downPayAmount": "0" * }, * "amountReceived": "0" * }, * "state": "PENDING_MARK_AS_PAID", * "wixPayMultipleDetails": [ * { * "txId": "893ee533-22fe-4ee5-b2e4-a8aef5c4906c", * "orderId": "d91f9a7e-077f-4d47-9037-ff6a040787a9", * "orderAmount": "50", * "orderStatus": "UNDEFINED", * "paymentVendorName": "offline" * } * ] * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?