updateBusinessContact( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a site's business contact information.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Business Contact
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function updateBusinessContact(
  businessContact: BusinessContactData,
  options: UpdateBusinessContactOptions,
): Promise<void>;
Method Parameters
businessContactBusinessContactDataRequired

The site's business contact information.


optionsUpdateBusinessContactOptions
This example uses elevate(), which enables site visitors to call functions without the required permissions. Exercise caution when using elevate() to prevent security vulnerabilities.
JavaScript
import { siteProperties } from "wix-business-tools.v2"; import { elevate } from "wix-auth"; /* Sample businessContact value: * { * address: { * apartmentNumber: '', * city: 'New York', * coordinates: { * latitude: 40.7128, * longitude: -74.0060 * }, * country: 'US', * googleFormattedAddress: '123 Broadway, New York, NY 10001', * hint: { * placement: 'BEFORE', * text: 'On the corner - front entrance on 5th Avenue' * }, * isPhysical: true, * state: 'NY', * street: 'Broadway', * streetNumber: '123', * zip: '10001' * }, * email: 'mainaddress@example.com', * fax: '011-1-212-555-6789', * phone: '212-555-1234' * } * * Sample fields value: ['address', 'email', 'fax', 'phone'] */ export async function myUpdateBusinessContactFunction(businessContact, fields) { try { const elevatedUpdateBusinessContact = elevate( siteProperties.updateBusinessContact, ); await elevatedUpdateBusinessContact(businessContact, fields); console.log("Successfully updated business contact"); return true; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to void */
Errors
401Unauthenticated

There is 1 error with this status code.

403Permission Denied

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?