---
title: Dealers API\_handler
slug: configured-commerce/docs/dealers-apihandler
docTags: 
createdAt: 2026-08-13T10:46:25.000Z
---

**HTTP Verb** – GET

**URL** – /api/v1/dealers

**Description** – Returns a collection of dealers

**Base** – `HandlerBase\<GetDealerCollectionParameter, GetDealerCollectionResult>`

**Handlers** –

| Order | Handler                      | Description                       |
| ----- | ---------------------------- | --------------------------------- |
| 500   | `GetDealerCollectionHandler` | Gets a collection of the dealers. |

| Order | Handler                  | Description                                                                                                                                                                                                                                                                                                             |
| ----- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | `GetCoordinates`         | Sets Latitude, Longitude and Radius properties in the result object.                                                                                                                                                                                                                                                    |
| 600   | `GetDealersCount`        | Retrieves dealers count using `DealerRepository`. The dealers count is stored in the `TotalCount` property in the result object.                                                                                                                                                                                        |
| 700   | `GetDealers`             | If `DealerId` parameter has a value, retrieves a dealers by `DealersId` parameter. Otherwise retrieves a dealers using `DealerRepository` by coordinates. The dealers are stored in the `DealerDtos` property in the result object.                                                                                     |
| 800   | `CreateGetDealerResults` | Retrieves `HtmlContent` for each dealer. Copy custom properties to each dealer object. Create `GetDealerResults` from `DealerDtos` and stored it in the `GetDealerResults` property in the result object. Also find `DistanceUnitOfMeasure` and stored it in the `DistanceUnitOfMeasure` property in the result object. |

**HTTP Verb** – GET

**URL** – /api/v1/dealers/

**Description** – Returns a single dealer record

**Base** – `HandlerBase\<GetDealerParameter, GetDealerResult>`

**Handlers** –

| Order | Handler            | Description                                                                                                   |
| ----- | ------------------ | ------------------------------------------------------------------------------------------------------------- |
| 500   | `GetDealerHandler` | Gets a dealer for the matching `dealerId`, if an exception occurs a General Failure error result is returned. |

| Order | Handler     | Description                                                                                                                                                      |
| ----- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | `GetDealer` | Retrieves a dealer by `DealerId` parameter using `GetDealerCollectionHandler` handler chain. The dealer is stored in the `Dealer` property in the result object. |

**HTTP Verb** – GET

**URL** – /api/v1/dealers/getByPath

**Description** – Get a dealer by its URL path

**Base** – `HandlerBase\<GetDealerByPathParameter, GetDealerByPathResult\>`

**Handlers** –

| Order | Handler           | Description                                                                                                                                                                                                                                                                                                                                                          |
| ----- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | `GetDealerByPath` | Retrieves dealer details page URLs from cache (5-minute expiration) grouped by language. Extracts the dealer URL segment from the decoded path. Looks up the dealer by URL segment in the `DealerRepository`. Returns `NotFound` error if the dealer is not found. Populates the result with the dealer and its detail page path, including alternate language URLs. |

**HTTP Verb** – N/A (internal service call for Spire CMS page rendering)

**Description** – Get a dealer details page with dealer data for rendering

**Base** – `HandlerBase\<GetDealerPageParameter, GetDealerPageResult\>`

**Handlers** –

| Order | Handler            | Description                                                                                                                                                                                                                                                                                  |
| ----- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 100   | `ValidateContext`  | Retrieves the `DealerDetailsPage` from the content system. Returns error if the page is not found or not of type "`DealerDetailsPage`". Resolves the dealer details page URL for the current language. Handles language switching by parsing the URL segment from the previous language URL. |
| 200   | `GetDealer`        | Calls `DealerService.GetDealerByPath` with the resolved path. Returns `NotFound` error if the path is blank or the dealer is not found.                                                                                                                                                      |
| 300   | `CreateDealerPage` | Validates both the dealer details page and dealer exist. Sets alternate language URLs and the canonical URL on the page result using the dealer's language-specific URLs.                                                                                                                    |
