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.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function updateBusinessContact(
businessContact: BusinessContactData,
options: UpdateBusinessContactOptions,
): Promise<void>;
The site's business contact information.
elevate()
, which enables site visitors to call functions without the required permissions. Exercise caution when using elevate()
to prevent security vulnerabilities.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 */
There is 1 error with this status code.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.