> ## 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.

# Get locations by query

> Get a list of locations by specified filter criteria.



## OpenAPI

````yaml locations.openapi post /locations/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/search:
    post:
      tags:
        - Locations
      summary: Get locations by query
      description: Get a list of locations by specified filter criteria.
      operationId: searchLocation
      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: number
            default: 0
            example: 1
          example: 0
        - name: limit
          in: query
          description: Maximum number of records per page
          schema:
            type: number
            default: 10
            example: 10
          example: 10
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - $ref: '#/components/parameters/xFabricChannelIdOptional'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/locationSearchRequest'
        required: true
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/locationSearchResponse'
        '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:
    locationSearchRequest:
      type: object
      description: Sample request to search locations
      example:
        sort: '-location.createdAt'
        filters:
          - field: location.locationNum
            value: '11245'
            condition: EQ
          - field: location.type
            values:
              - DC
              - STORE
            condition: IN
      properties:
        sort:
          type: string
          default: '-location.createdAt'
          description: >-
            Property by which data is sorted. <p> **Note**: `-` refers to
            descending and `+` refers to ascending order.
          example: +location.createdAt
          pattern: (^[+-]location\.[a-zA-Z.\-_]*)(,([+-]location\.[a-zA-Z.\-_]*)){0,}
        filters:
          type: array
          items:
            $ref: '#/components/schemas/locationSearchFilter'
            description: List to filters for search
            maxItems: 50
            minItems: 0
          maxItems: 50
          minItems: 0
      required:
        - filters
    locationSearchResponse:
      type: object
      description: Location search response
      properties:
        pagination:
          $ref: '#/components/schemas/pagination'
        data:
          type: array
          items:
            $ref: '#/components/schemas/locationResponse'
        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
    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
    locationResponse:
      type: object
      description: >-
        Response object containing details about a specific location, including
        its configuration, operational status, capacity, and service attributes.
      properties:
        locationId:
          type: string
          description: A system-generated globally unique identifier for the location.
          example: 9372919a8219e8
        locationNumber:
          type: integer
          format: int32
          description: A merchant-defined unique identifier used to reference the location.
          example: 23
        isActive:
          type: boolean
          description: >-
            Indicates whether the location is currently active for order
            fulfillment. `true` Location is active. `false` Location is
            inactive.
          example: true
        address:
          $ref: '#/components/schemas/locationAddress'
          description: The physical address associated with the location.
        type:
          type: string
          description: >-
            The type or classification of the location (for example, DC for
            Distribution Center, Store).
          example: DC
        capacity:
          $ref: '#/components/schemas/capacity'
          description: >-
            Capacity limits and allocation settings that define how many orders
            the location can fulfill.
        services:
          type: object
          description: >-
            Custom service-level attributes associated with the location. Often
            used for filtering or routing (for example, by brand or channel).
          example:
            brand: WHBM
            channel: Frontline
        zones:
          type: array
          description: >-
            A list of shipping zones associated with the location for delivery
            or operational routing.
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          description: >-
            The timestamp of 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: >-
            The timestamp of the most recent update to the location record, in
            ISO 8601 UTC format.
          example: '2022-05-25T07:58:30.996Z'
        operatingHours:
          type: array
          description: >-
            Weekly schedule detailing the hours during which the location
            operates.
          items:
            $ref: '#/components/schemas/operatingHours'
        coordinates:
          $ref: '#/components/schemas/geoJsonPoint'
          description: >-
            The geographical coordinates of the location in GeoJSON format. Must
            follow the format `[longitude, latitude]`, where longitude ∈ [-180,
            180] and latitude ∈ [-90, 90].
          example:
            type: Point
            coordinates:
              - -122.3493
              - 47.6205
        attributes:
          type: object
          description: Custom key-value metadata or flags associated with the location.
          example:
            isReturns: 'true'
        supportedCarriers:
          type: array
          description: >-
            A list of shipping carriers supported by this location for outbound
            or inbound logistics.
          items:
            $ref: '#/components/schemas/Carrier'
        activeFulfillmentMethods:
          type: object
          description: >-
            A map of fulfillment methods currently active and supported by this
            location (for example, ShipToHome, Pickup).
          example:
            ShipToHome: 'true'
        transfer:
          $ref: '#/components/schemas/transfer'
          description: >-
            Transfer configuration settings for inventory movement related to
            this location.
        name:
          type: string
          description: >-
            The display name of the location, typically shown in the User
            Interface and reports.
          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

````