Showrooms and locations
A showroom is a dealer (or dealer group, or brand) on Vyro, with its own website and stock. A showroom has locations: dealerships, service centres and delivery points.
Get a showroom
Section titled “Get a showroom”By code, domain or id:
query ShowroomByCode($code: String!) { showrooms(where: { code: { _eq: $code } }, limit: 1) { id code name domain https_enabled phone email timezone default_locale default_pricing_code }}query ShowroomByDomain($domain: String!) { showrooms(where: { domain: { _eq: $domain } }, limit: 1) { id name }}List locations
Section titled “List locations”query Locations($showroomId: uuid!) { locations( where: { showroom_id: { _eq: $showroomId }, is_dealership: { _eq: true } } order_by: [{ display_order: asc_nulls_last }, { name: asc }] ) { id name code phone email address timezone opening_hours geography is_available_for_test_drives }}address is JSON:
{ "address_line_1": "33 Breakfast Creek Road", "city": "Newstead", "state": "Queensland", "postcode": "4006", "country_code": "AU", "latitude": -27.450758, "longitude": 153.034073, "formatted_address": "33 Breakfast Creek Rd, Newstead QLD 4006, Australia"}state can be the full name (Queensland) or the abbreviation (QLD). Normalise it before you use it; see State pricing.
Nearest locations
Section titled “Nearest locations”geography is a GeoJSON point. Find locations within 50 km (distances are in metres; coordinates are longitude, latitude):
query Nearby($showroomId: uuid!, $point: geography!) { locations( where: { showroom_id: { _eq: $showroomId } geography: { _st_d_within: { distance: 50000, from: $point } } } ) { name address }}{ "point": { "type": "Point", "coordinates": [151.2093, -33.8688] } }