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 profile.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function updateBusinessProfile(
businessProfile: BusinessProfileData,
options: UpdateBusinessProfileOptions,
): Promise<void>;
The site's business profile.
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 businessProfile value:
* {
* description: 'Whatever the occasion, we have what you need.',
* logo: 'a8a52b_bf5596e614d8484e9f1d429ac256e1ad~mv2.jpeg'
* }
*
* Sample fields value: ['description', 'logo']
*/
export async function myUpdateBusinessProfileFunction(businessProfile, fields) {
try {
const elevatedUpdateBusinessProfile = elevate(
siteProperties.updateBusinessProfile,
);
await elevatedUpdateBusinessProfile(businessProfile, fields);
console.log("Successfully updated business profile");
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.