> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # ValidateOperationAddress # Package: onlineOrders # Namespace: OperationsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/validate-operation-address.md ## Permission Scopes: Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES ## Introduction Validates an operation's address. The method checks if the operation's address stored in `businessLocationDetails.address` is valid. An address is considered valid if it has: 1. A non-empty, formatted address. 2. Valid geocode coordinates (not 0,0). 3. A non-empty country field. If the address is invalid, the response includes specific violations. --- ## REST API ### Schema ``` Method: validateOperationAddress Description: Validates an operation's address. The method checks if the operation's address stored in `businessLocationDetails.address` is valid. An address is considered valid if it has: 1. A non-empty, formatted address. 2. Valid geocode coordinates (not 0,0). 3. A non-empty country field. If the address is invalid, the response includes specific violations. URL: https://www.wixapis.com/restaurants-operations/v1/operations/{operationId}/validate-address Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: operationId Method parameters: param name: operationId | type: none | required: true Return type: ValidateOperationAddressResponse - name: valid | type: boolean | description: Whether the address is valid. - name: violations | type: array | description: List of violations. Empty if the address is invalid. - name: type | type: ViolationType | description: Type of violation in the address. - enum: - UNKNOWN: Default value. - NO_ADDRESS: The operation has no address configured. - MISSING_FORMATTED_ADDRESS: The address exists but is missing a formatted address string. - INVALID_GEOCODE: The address has invalid or missing geocoding information. - MISSING_COUNTRY: The address is missing country information. - MISSING_SUBDIVISION: The address is missing subdivision information. ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.onlineOrders.OperationsService.validateOperationAddress(operationId) Description: Validates an operation's address. The method checks if the operation's address stored in `businessLocationDetails.address` is valid. An address is considered valid if it has: 1. A non-empty, formatted address. 2. Valid geocode coordinates (not 0,0). 3. A non-empty country field. If the address is invalid, the response includes specific violations. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: operationId Method parameters: param name: operationId | type: string | description: The GUID of the operation whose address should be validated. | required: true Return type: PROMISE - name: valid | type: boolean | description: Whether the address is valid. - name: violations | type: array | description: List of violations. Empty if the address is invalid. - name: type | type: ViolationType | description: Type of violation in the address. - enum: - UNKNOWN: Default value. - NO_ADDRESS: The operation has no address configured. - MISSING_FORMATTED_ADDRESS: The address exists but is missing a formatted address string. - INVALID_GEOCODE: The address has invalid or missing geocoding information. - MISSING_COUNTRY: The address is missing country information. - MISSING_SUBDIVISION: The address is missing subdivision information. ``` ### Examples ### validateOperationAddress ```javascript import { operations } from '@wix/restaurants'; async function validateOperationAddress(operationId) { const response = await operations.validateOperationAddress(operationId); }; ``` ### validateOperationAddress (with elevated permissions) ```javascript import { operations } from '@wix/restaurants'; import { auth } from '@wix/essentials'; async function myValidateOperationAddressMethod(operationId) { const elevatedValidateOperationAddress = auth.elevate(operations.validateOperationAddress); const response = await elevatedValidateOperationAddress(operationId); } ``` ### validateOperationAddress (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { operations } from '@wix/restaurants'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { operations }, // Include the auth strategy and host as relevant }); async function validateOperationAddress(operationId) { const response = await myWixClient.operations.validateOperationAddress(operationId); }; ``` ---