Archives a location.
Notes:
archived
boolean of a location to true
.status
using this endpoint.default
location can't be archived.You can only call this method when authenticated as a Wix app or Wix user identity.
function archiveLocation(_id: string): Promise<ArchiveLocationResponse>;
ID of the location to archive.
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",
* }
*/
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.