archiveLocation( )


Archives a location.

Notes:

  • Changes the archived boolean of a location to true.
  • You can't change a location's status using this endpoint.
  • Archived locations can't be updated.
  • The default location can't be archived.
Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Locations
Learn more about app permissions.
Method Declaration
Copy
function archiveLocation(_id: string): Promise<ArchiveLocationResponse>;
Method Parameters
_idstringRequired

ID of the location to archive.

Returns
Return Type:Promise<ArchiveLocationResponse>
JavaScript
import { locations } from "@wix/business-tools"; /* Sample _id value: '0a965e36-4071-4df0-905b-75458817430a' */ export async function myArchiveLocationFunction(_id) { try { const archivedLocation = await locations.archiveLocation(_id); console.log("Location has been archived:", archivedLocation); return archivedLocation; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_id": "0a965e36-4071-4df0-905b-75458817430a" * "address": { * "streetAddress": { * "apt": "", * "name": "New Road", * "number": "12" * }, * "city": "Kolkata", * "postalCode": "70027" * }, * "archived": true, * "default": false, * "description": "New store in India!", * "email": "store@example.com", * "name": "India Store", * "phone": "0208 209 9087", * "revision": "2", * "status": "ACTIVE", * "timeZone": "Asia/Calcutta", * } */
Errors
400Invalid Argument

There is 1 error with this status code.

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

Did this help?