> 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 # Method name: onLocationCreated(event: LocationCreated) # Method package: wixBusinessToolsV2 # Method menu location: wixBusinessToolsV2 --> onLocationCreated # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/business-tools/events/on-location-created.md # Method Description: Triggered when a location is created. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event that triggers when a location is created ```javascript // Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixLocations_onLocationCreated(event) { const createdTime = event.metadata.eventTime; console.log(`Location was created at ${createdTime}. Event details:`, event) } /* Full event object: * { * "entity": { * "_id": "a636dae4-fdc9-4da8-9eef-7b0d23b34f22", * "address": { * "city": "São Paulo", * "country": "BR", * "formatted": "123 Avenida Paulista, São Paulo", * "location": { * "latitude": -23.561722, * "longitude": -46.655275 * }, * "postalCode": "01311-000" * "streetAddress": { * "apt": "" * "name": "Avenida Paulista", * "number": "123", * }, * "subdivision": "BR-SP", * }, * "archived": false, * "businessSchedule": { * "periods": [ * { * "closeDay": "MONDAY", * "closeTime": "18:00", * "openDay": "MONDAY", * "openTime": "08:00" * }, * { * "closeDay": "TUESDAY", * "closeTime": "18:00", * "openDay": "TUESDAY", * "openTime": "08:00" * }, * { * "closeDay": "WEDNESDAY", * "closeTime": "18:00", * "openDay": "WEDNESDAY", * "openTime": "08:00" * }, * { * "closeDay": "THURSDAY", * "closeTime": "18:00", * "openDay": "THURSDAY", * "openTime": "08:00" * }, * { * "closeDay": "FRIDAY", * "closeTime": "18:00", * "openDay": "FRIDAY", * "openTime": "08:00" * } * ], * "specialHourPeriod": [ * { * "comment": "Half price in the lead up to Christmas!", * "endDate": "2023-12-24T23:59:00Z", * "isClosed": false, * "startDate": "2023-12-01T00:00:00Z" * } * ] * }, * "default": false, * "description": "Our location in São Paulo City Center!", * "email": "saopaulo@example.com", * "fax": "011-55-11-987654321", * "name": "São Paulo City Center Store", * "phone": "011 98765 4321", * "revision": "1", * "status": "ACTIVE", * "timeZone": "America/Sao_Paulo", * }, * "metadata": { * "entityId": "a636dae4-fdc9-4da8-9eef-7b0d23b34f22", * "eventTime": "2023-11-13T08:22:25.392520Z", * "id": "a41b6434-982d-413d-8ce0-ac4dd8d3dc00", * "triggeredByAnonymizeRequest": false * } * } */ ``` ---