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

# Search Nearby Locations

> Searches for nearby locations based on a specified address or coordinate input. Useful for location-aware services and delivery matching.



## OpenAPI

````yaml locations.openapi post /locations/geography-search
openapi: 3.0.1
info:
  contact:
    email: support@fabric.inc
    name: fabric Orders team
  description: >-
    fabric **Locations** API provides location endpoints that support
    multi-tenant services. This location data is used for both inventory
    management and order management. When an order is created, it's allocated to
    the nearest location according to the Order Fulfillment Logic.
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
  title: Inventory - Locations API
  version: 3.0.0
  x-audience: external-public
servers:
  - description: Production
    url: https://api.fabric.inc/v3
security:
  - authorization: []
tags:
  - description: These Endpoints help in performing Outage operations
    name: Location Outage Endpoints
  - description: These endpoints let you create and manage locations.
    name: Locations
  - description: These Endpoints help in performing capacity operations
    name: Location Capacity Endpoints
  - name: Location Geography Endpoints
    description: These Endpoints help in performing Geography operations
  - name: Location Zone Endpoints
    description: These Endpoints help in performing Zone operations
paths:
  /locations/geography-search:
    post:
      tags:
        - Locations
      summary: Search Nearby Locations
      description: >-
        Searches for nearby locations based on a specified address or coordinate
        input. Useful for location-aware services and delivery matching.
      operationId: searchGeography
      parameters:
        - name: offset
          in: query
          description: >-
            Number of records to skip before returning all records. Default is
            `0` when no value is specified.
          schema:
            type: integer
            format: int32
            default: 0
            example: 0
          example: 0
        - name: limit
          in: query
          description: Maximum number of records per page
          schema:
            type: integer
            format: int32
            default: 10
            example: 10
            maximum: 100
            minimum: 1
          example: 10
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - $ref: '#/components/parameters/xFabricChannelIdOptional'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/locationGeoSearchRequest'
        required: true
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/locationGeoSearchResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
              example:
                type: CLIENT_ERROR
                errorCode: SERVICE-4003
                message: 'Mandatory param(s): `requiredField1` is/are missing'
                errors:
                  - type: CLIENT_ERROR
                    errorCode: SERVICE-4002
                    message: Invalid value(s) specified for 'requiredField.field3'
                    errors: []
                context:
                  service: orders
                  endpoint: POST /v3/orders
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
              example:
                type: CLIENT_ERROR
                errorCode: SERVICE-4001
                message: Unauthorized request
                errors: []
                context:
                  service: orders
                  endpoint: POST /v3/orders/OrderId_12345
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
              example:
                type: SERVER_ERROR
                errorCode: SERVICE-5000
                message: Internal server error
                errors: []
                context:
                  service: inventories
                  endpoint: POST /v3/inventories/actions/find-by-geography
components:
  parameters:
    xFabricTenantId:
      description: >-
        A header used by fabric to identify the tenant making the request. You
        must include tenant id in the authentication header for an API request
        to access any of fabric’s endpoints. You can retrieve the tenant id ,
        which is also called account id, from
        [Copilot](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
      example: 5f328bf0b5f328bf0b5f328b
      in: header
      name: x-fabric-tenant-id
      required: true
      schema:
        type: string
    xFabricRequestId:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      in: header
      name: x-fabric-request-id
      required: false
      schema:
        type: string
    xFabricChannelIdOptional:
      description: >-
        x-fabric-channel-id identifies the sales channel through which the API
        request is being made; primarily for multichannel use cases. It is an
        optional field. The default US channel is 12 while the default Canada
        channel is 13.
      example: '12'
      in: header
      name: x-fabric-channel-id
      required: false
      schema:
        type: string
  schemas:
    locationGeoSearchRequest:
      type: object
      description: Criteria to search geo location
      example:
        filters:
          - field: TYPE
            value:
              - DC
              - Store
        origin:
          city: San Francisco
          country: United States
          minDistance: '5'
          maxDistance: '50'
          postalCode: '89135'
          region: New York
      properties:
        filters:
          type: array
          items:
            $ref: '#/components/schemas/locationSearchFilter'
            description: List to filters for search
            maxItems: 50
            minItems: 0
          maxItems: 50
          minItems: 0
        origin:
          $ref: '#/components/schemas/geoOrigin'
          description: >-
            Geo search origin. Must include `postalCode` OR (`city` and
            `region`).
      required:
        - filters
        - origin
    locationGeoSearchResponse:
      type: object
      description: Location geo search response
      properties:
        pagination:
          $ref: '#/components/schemas/pagination'
        data:
          type: array
          items:
            $ref: '#/components/schemas/nearbyLocationResponse'
        stats:
          type: array
          items:
            type: string
            description: Stats Details
    errorResponse:
      type: object
      description: Error response
      properties:
        type:
          type: string
          description: Error type
          example: CLIENT_ERROR
        errorCode:
          type: string
          description: Error code
          example: OMS-10001
        message:
          type: string
          description: Error message
          example: Bad request
        errors:
          type: array
          items:
            $ref: '#/components/schemas/errorResponse'
        context:
          type: string
          description: Error message
          example: Bad request
    locationSearchFilter:
      type: object
      description: >-
        Criteria to search locations. To search using a single value,
        `valueSearchFilter` is used. To search using multiple values,
        `valuesSearchFilter` is used.
      discriminator:
        propertyName: condition
        mapping:
          EQ:
            $ref: '#/components/schemas/valueSearchFilter'
          NEQ:
            $ref: '#/components/schemas/valueSearchFilter'
          LT:
            $ref: '#/components/schemas/valueSearchFilter'
          GT:
            $ref: '#/components/schemas/valueSearchFilter'
          LTE:
            $ref: '#/components/schemas/valueSearchFilter'
          GTE:
            $ref: '#/components/schemas/valueSearchFilter'
          IN:
            $ref: '#/components/schemas/valuesSearchFilter'
          NIN:
            $ref: '#/components/schemas/valuesSearchFilter'
      properties:
        group:
          type: string
          default: Default
          description: Group name
          example: GroupA
        field:
          type: string
          description: Field name
          example: location.locationNum
          pattern: ^location\.[a-zA-Z.\-_]*
        condition:
          type: string
          default: EQ
          description: >-
            Filter conditions. <br> EQ (Equal to): Searches for exact match.
            <br> NEQ (Not equal to): Searches by excluding the specified value.
            <br> IN: Search for multiple values. <br> NIN (Not IN): Excludes the
            specified values in the search. LT (Less than): Searches for values
            that are less than the specified value. GT (Greater than):  Search
            for values that are greater than the specified value. LTE (Less than
            or equal to): Searches for values that are less than or equal to the
            specified value. GTE (Greater than or equal to): Searches for values
            that are greater than or equal to the specified value.
          enum:
            - EQ
            - NEQ
            - IN
            - NIN
            - LT
            - GT
            - LTE
            - GTE
          example: EQ
      required:
        - condition
        - field
    geoOrigin:
      type: object
      description: Geo search origin. Must include `postalCode` OR (`city` and `region`).
      properties:
        postalCode:
          type: string
          description: Postal code from where nearby locations are to be searched
          example: 94008
        city:
          type: string
          description: City for which location will be searched
          example: San Francisco
        region:
          type: string
          description: Region for which location will be searched
          example: New York
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 based country code
          example: US
        minDistance:
          type: number
          format: double
          default: '0.0'
          description: >-
            Minimum distance (in radius) from the specified postal code within
            which the location will be searched
          example: 10
        maxDistance:
          type: number
          format: double
          default: '100.0'
          description: >-
            Maximum distance (in radius) from the specified postal code within
            which the location will be searched
          example: 100
        distanceUnit:
          type: string
          default: MILE
          description: Distance unit
          enum:
            - MILE
            - KILOMETER
            - METER
          example: MILE
      required:
        - city
        - countryCode
        - postalCode
        - region
    pagination:
      type: object
      description: Pagination response
      properties:
        limit:
          type: integer
          format: int32
          default: '10'
          description: Maximum number of records per page
          example: 10
          maximum: 100
          minimum: 1
        offset:
          type: integer
          format: int32
          default: '0'
          description: >-
            Number of records to skip before returning all records. For example,
            `offset=20, limit=10` returns records 21-30.
          example: 1
          minimum: 0
        count:
          type: integer
          format: int32
          description: Total number of search results
          example: 1000
    nearbyLocationResponse:
      type: object
      description: >-
        Response object representing a nearby location relative to a specified
        address, including metadata such as distance, status, and capabilities.
      properties:
        distance:
          type: number
          format: double
          description: >-
            Distance between the queried address and the location, typically
            measured in meters.
          example: 100
        locationId:
          type: string
          description: System-generated unique identifier for the location.
          example: 9372919a8219e8
        locationNumber:
          type: integer
          format: int32
          description: Merchant-defined unique identifier for the location.
          example: 23
        isActive:
          type: boolean
          description: >-
            Indicates whether the location is currently active for order
            fulfillment operations. A value of `true` means active; `false`
            means inactive.
          example: true
        address:
          $ref: '#/components/schemas/locationAddress'
          description: Physical address associated with the location.
        type:
          type: string
          description: >-
            Classification of the location (for example, distribution center,
            retail store).
          example: DC
        capacity:
          $ref: '#/components/schemas/capacity'
          description: Capacity constraints and allocation limits defined for the location.
        services:
          type: object
          description: >-
            Custom service attributes that define or categorize the location.
            Often used for routing or filtering purposes.
          example:
            brand: WHBM
            channel: Frontline
        zones:
          type: array
          description: A list of shipping zones associated with the location.
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          description: >-
            Timestamp indicating when the location record was created, in ISO
            8601 UTC format.
          example: '2022-05-25T07:58:30.996Z'
        updatedAt:
          type: string
          format: date-time
          description: >-
            Timestamp indicating when the location record was last updated, in
            ISO 8601 UTC format.
          example: '2022-05-25T07:58:30.996Z'
        operatingHours:
          type: array
          description: Weekly schedule defining the operating hours of the location.
          items:
            $ref: '#/components/schemas/operatingHours'
        coordinates:
          $ref: '#/components/schemas/geoJsonPoint'
          description: >-
            Geographic coordinates in GeoJSON format. Must be in the form
            `[longitude, latitude]` with longitude between -180 and 180, and
            latitude between -90 and 90.
          example:
            type: Point
            coordinates:
              - -122.3493
              - 47.6205
        attributes:
          type: object
          description: Additional metadata or flags related to the location.
          example:
            isReturns: 'true'
        supportedCarriers:
          type: array
          description: List of shipping carriers supported by this location.
          items:
            $ref: '#/components/schemas/Carrier'
        activeFulfillmentMethods:
          type: object
          description: >-
            A map of fulfillment methods currently supported and enabled at the
            location.
          example:
            ShipToHome: 'true'
        transfer:
          $ref: '#/components/schemas/transfer'
          description: Configuration for inventory transfers to or from the location.
        name:
          type: string
          description: Human-readable name of the location.
          example: Seattle Store
      required:
        - locationNumber
        - name
    valueSearchFilter:
      allOf:
        - $ref: '#/components/schemas/locationSearchFilter'
        - type: object
          properties:
            value:
              type: object
              description: A single value for `field` using which data is searched
              example: ORDER_CREATE
              oneOf:
                - type: string
                  description: Target record's non-numeric identifier
                  example: ORDER_CREATE
                - type: number
                  format: int64
                  description: Target record's numeric identifier
                  example: 112233
                - type: number
                  format: double
                  description: Target record's numeric identifier
                  example: 1122.33
      description: >-
        Criteria to find location using a single value. Condition between
        `field` and `value` is anything except IN and NIN when
        `valueSearchFilter` is used.
      required:
        - condition
        - field
    valuesSearchFilter:
      allOf:
        - $ref: '#/components/schemas/locationSearchFilter'
        - type: object
          properties:
            values:
              type: array
              items:
                description: Multiple values for `field` using which locations are searched
                example: ORDER_CREATE
                oneOf:
                  - type: string
                    description: Target record's non-numeric identifier
                    example: ORDER_CREATE
                  - type: number
                    format: int64
                    description: Target record's numeric identifier
                    example: 112233
                  - type: number
                    format: double
                    description: Target record's numeric identifier
                    example: 1122.33
              maxItems: 25
              minItems: 0
      description: >-
        Criteria to find locations using multiple values. Condition between
        `field` and `values` is either IN or NIN when `valuesSearchFilter` is
        used.
      required:
        - condition
        - field
    locationAddress:
      type: object
      description: Address details
      properties:
        addressLine1:
          type: string
          description: Address line 1
          example: 123
        addressLine2:
          type: string
          description: Address line 2
          example: Suite 100
        addressLine3:
          type: string
          description: Address line 3
          example: Seventh floor
        addressLine4:
          type: string
          description: Address line 4
          example: 'Attention: Pat E. Kake'
        city:
          type: string
          description: City name
          example: Seattle
        region:
          type: string
          description: Region or state
          example: WA
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 based country code
          example: US
        postalCode:
          type: string
          description: Postal or ZIP code
          example: 98121
        type:
          type: string
          description: Address type
          example: Home
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/contact'
      required:
        - region
    capacity:
      type: object
      description: >-
        Location Capacity Model used by fulfillment specialist to optimize
        fulfillments across the distribution network and monitor productivity by
        location
      properties:
        maxAllocations:
          type: integer
          format: int32
          description: >-
            Maximum allocations this location can take at any given time. When
            `currentAllocations=maxAllocations`, this location is AtCapacity and
            cannot take any further allocations.
          example: 30
        currentAllocations:
          type: integer
          format: int32
          description: Current allocations at this location.
          example: 5
          readOnly: true
        infiniteAllocation:
          type: boolean
        allocationPercentage:
          type: integer
          format: int32
          description: >-
            Current percentage of allocations at this location. Calculated by
            `(currentAllocations / maxAllocations)*100`.
          example: 20
        isCapacityFull:
          type: boolean
          description: If location has no allocation capacity limit.
          example: true
    operatingHours:
      type: object
      description: Store operating hour
      properties:
        day:
          type: string
          description: Day of week
          enum:
            - SUNDAY
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
          example: SUNDAY
        hours:
          type: array
          items:
            $ref: '#/components/schemas/hours'
    geoJsonPoint:
      type: object
      description: Location coordinates
      example:
        type: Point
        coordinates:
          - -122.3493
          - 47.6205
      properties:
        type:
          type: string
          description: Geo coordinate type
          example: Point
        coordinates:
          type: array
          items:
            format: double
            description: Coordinate value
            example: 36.0552222
    Carrier:
      type: object
      description: Location supported carrier
      properties:
        carrier:
          type: string
          description: Carrier name
          example: FedEx
        serviceLevels:
          type: array
          items:
            $ref: '#/components/schemas/LocationSupportedCarrierServiceLevels'
    transfer:
      type: object
      description: Location transfer Model used setup transfer configuration for location
      properties:
        isAutoReceiving:
          type: boolean
          description: Enable or disable auto receiving for transfer
        autoStockWindow:
          type: string
          description: Sets the auto stock window for location transfer
          example: PT10M
    contact:
      type: object
      description: Contact details
      properties:
        type:
          type: string
          description: Contact type
          example: OFFICE
        email:
          type: string
          description: E-mail address
          example: abc@mail.com
        phone:
          type: array
          items:
            $ref: '#/components/schemas/phone'
        name:
          $ref: '#/components/schemas/name'
    hours:
      type: object
      description: Store operating hours
      properties:
        open:
          type: string
          description: Store opening time, measured in 24-hour format
          example: 10
        close:
          type: string
          description: Closing time for given hour type
          example: 20
        type:
          type: string
          description: Type of location operation
          example: PICK_UP
    LocationSupportedCarrierServiceLevels:
      type: object
      description: >-
        A list of carrier service levels supported by a specific location,
        including the carrier name and corresponding shipping method used by
        fabric.
      properties:
        name:
          type: string
          description: The name of the external shipping carrier providing the service.
          example: FedEx
        shippingMethod:
          type: string
          description: >-
            The name of the corresponding shipping method as defined in fabric's
            system.
          example: FedEx
    phone:
      type: object
      description: Phone number details
      properties:
        number:
          type: string
          description: Phone number
          example: '0281923712'
        type:
          type: string
          description: Phone type
          example: MOBILE
    name:
      type: object
      description: Contact person's name for the location
      properties:
        firstName:
          type: string
          description: First name
          example: Pat
        middleName:
          type: string
          description: Middle name or initial
          example: E
        lastName:
          type: string
          description: Last name
          example: Kake
  headers:
    xFabricRequestIdResponseHeader:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
      schema:
        type: string
  securitySchemes:
    authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````