Dealer Locator API

Overview

The Dealer Locator API allows you to find the nearest dealer to a specific location based on postal code and country. Use it to power dealer finder features on websites and applications.

Endpoint

GET /dealer-locator

Authentication

Requests require the X-API-Token header with your API token:

X-API-Token: your_api_token_here

Parameters

Name Type Required Description
brand string Yes Brand identifier slug (provided by your administrator)
postal_code string Yes US ZIP code (5 digits) or Canadian postal code (A1A 1A1)
country string Yes Two-letter country code: US or CA

Example Request

curl -X GET "https://api.marquatica.com/dealer-locator?brand=your_brand&postal_code=90210&country=US" \
  -H "X-API-Token: your_api_token_here"

Success Response

Dealer Found

{
  "success": true,
  "nearest_dealer": {
    "dealer_id": 15,
    "name": "Buxton Marine Sales, L.P.",
    "address": "1566 North Stemmons Frwy",
    "city": "Lewisville",
    "state": "TX",
    "postal_code": "75067",
    "country": "USA",
    "phone": "972-436-2628",
    "email": "michael@buxtonmarine.com",
    "website": "https://buxtonmarine.com",
    "distance_miles": 1232.9
  }
}

No Dealer Found

{
  "success": true,
  "nearest_dealer": null,
  "message": "No dealers found in this area"
}

Response Fields

Field Type Description
success boolean Whether the request was successful
nearest_dealer object/null Dealer information or null if none found
nearest_dealer.dealer_id integer Unique dealer identifier
nearest_dealer.name string Dealer business name
nearest_dealer.address string Street address
nearest_dealer.city string City name
nearest_dealer.state string State or province abbreviation
nearest_dealer.postal_code string Postal code
nearest_dealer.country string Country name
nearest_dealer.phone string Dealer phone number
nearest_dealer.email string Dealer email address
nearest_dealer.website string Dealer website URL
nearest_dealer.distance_miles number Distance from the postal code in miles

Error Response Examples

Missing Brand Parameter

{
  "error": "Brand parameter is required",
  "version": "0.1.1"
}

Invalid Postal Code Format

{
  "error": "Invalid US postal code format. Must be exactly 5 digits (e.g., 12345)",
  "version": "0.1.1"
}

Invalid Country Code

{
  "error": "Invalid country code. Use US or CA",
  "version": "0.1.1"
}

Country Code Support

Supported Countries:
  • US — United States (5-digit ZIP codes, e.g., 90210)
  • CA — Canada (postal codes in A1A 1A1 format)

Notes

  • Distances are calculated using the Haversine formula
  • Only dealers in the same country are returned
  • Only active dealers are included in results
On this page