> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r4technology.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Find Locations

> Find the nearest drop off points to a customer address within a specified maximum distance



## OpenAPI

````yaml POST /locations/nearest
openapi: 3.1.0
info:
  title: R4 API
  description: API for integrating dry cleaning location services and order tracking
  version: 1.0.0
servers:
  - url: https://dev.api.r4technology.io
security:
  - basicAuth: []
paths:
  /locations/nearest:
    post:
      description: >-
        Find the nearest drop off points to a customer address within a
        specified maximum distance
      requestBody:
        description: Customer address and search criteria
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NearestLocationsRequest'
        required: true
      responses:
        '200':
          description: List of nearby locations ordered by distance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NearestLocationsResponse'
              example:
                code: Success
                locations:
                  - name: Antons Cleaners - 135 W Broadway St
                    address: 135 W. Broadway St.
                    city: Boston
                    state: MA
                    zip: '02127'
                    business_hours:
                      Monday: 7:00 AM - 7:00 PM
                      Tuesday: 7:00 AM - 7:00 PM
                      Wednesday: 7:00 AM - 7:00 PM
                      Thursday: 7:00 AM - 7:00 PM
                      Friday: 7:00 AM - 7:00 PM
                      Saturday: 8:00 AM - 5:00 PM
                      Sunday: Closed
                    lat: '42.3406939'
                    lng: '-71.0542802'
                    distance: 0.219298791554029
        '400':
          description: Invalid customer address or geocoding error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NearestLocationsRequest:
      required:
        - customer_address
        - max_distance
      type: object
      properties:
        customer_address:
          $ref: '#/components/schemas/CustomerAddress'
        max_distance:
          description: Maximum distance in miles to search for locations
          type: number
          format: float
          default: 5
    NearestLocationsResponse:
      type: object
      properties:
        code:
          description: Response status code
          type: string
        locations:
          description: Array of nearby locations ordered by distance (ascending)
          type: array
          items:
            $ref: '#/components/schemas/Location'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    CustomerAddress:
      required:
        - zip
      type: object
      properties:
        address:
          description: Street address
          type: string
        city:
          description: City name
          type: string
        state:
          description: State abbreviation
          type: string
        zip:
          description: ZIP code (required field)
          type: string
          default: '02127'
    Location:
      type: object
      properties:
        name:
          description: Location name
          type: string
        address:
          description: Street address
          type: string
        city:
          description: City name
          type: string
        state:
          description: State abbreviation
          type: string
        zip:
          description: ZIP code
          type: string
        business_hours:
          description: Business hours by day of week
          type: object
          additionalProperties:
            type: string
        lat:
          description: Latitude coordinate (string format)
          type: string
        lng:
          description: Longitude coordinate (string format)
          type: string
        distance:
          description: Distance from customer address in miles
          type: number
          format: float
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````