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

# List Locations

> Retrieve a list of locations. The list can be filtered, sorted, and paginated using the parameters below.



## OpenAPI

````yaml get /locations
openapi: 3.1.0
info:
  title: Locations API
  description: >-
    API for managing locations


    ### Resource identifier format


    Resource identifiers (the `id` field and related global-identifier fields)
    are returned as JSON

    integers by default. To receive them as strings instead, send the

    `X-Loop-Global-Identifier-Type: string` request header.
  version: v1
servers:
  - url: https://api.loopreturns.com/api/v1
security: []
tags:
  - name: Locations
    description: Operations related to managing locations
paths:
  /locations:
    get:
      tags:
        - Locations
      summary: List Locations
      description: >-
        Retrieve a list of locations. The list can be filtered, sorted, and
        paginated using the parameters below.
      operationId: listLocations
      parameters:
        - in: query
          name: external_id
          schema:
            type: string
            maxLength: 64
          example: 564400c7-7a6b-4f29-b6a5-7bb580b2992c
          description: An `external_id` used to filter the locations.
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 250
            default: 50
          example: 20
          description: The maximum number of locations returned.
        - in: query
          name: sort_order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          example: desc
          description: The sort order for the results.
        - in: query
          name: cursor
          schema:
            type: string
          description: The cursor to return the next page of results.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - locations
                properties:
                  locations:
                    type: array
                    items:
                      $ref: '#/components/schemas/LocationResponse'
                  next_page_url:
                    type:
                      - string
                      - 'null'
                  previous_page_url:
                    type:
                      - string
                      - 'null'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
      security:
        - read: []
components:
  schemas:
    LocationResponse:
      type: object
      required:
        - id
        - sales_channel
        - name
        - status
        - address
      properties:
        id:
          type: integer
          format: int64
          description: The unique integer identifier for the location, created by Loop.
          examples:
            - 9007199254740991
        external_id:
          type:
            - string
            - 'null'
          description: The identifier used by an external source to identify the location.
          examples:
            - 62291d16-9b61-4fbb-b868-21c2d32dc155
        sales_channel:
          type: string
          description: The name of the channel.
          examples:
            - shopify
        name:
          type: string
          maxLength: 100
          description: The name of the location.
          examples:
            - Main Warehouse
        status:
          type: string
          description: The status of the location.
          enum:
            - active
            - inactive
        address:
          $ref: '#/components/schemas/AddressResponseData'
          description: The address of the location.
    UnauthorizedResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: string
          examples:
            - Unauthorized.
    AddressResponseData:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          maxLength: 100
          description: The name of the address.
          examples:
            - Main Warehouse
        company:
          type:
            - string
            - 'null'
          maxLength: 100
          description: The name of the company residing at the address.
          examples:
            - Universal Exports
        address1:
          type:
            - string
            - 'null'
          maxLength: 125
          description: Line 1 of the address.
          examples:
            - 1234 Example Street
        address2:
          type:
            - string
            - 'null'
          maxLength: 125
          description: Line 2 of the address.
          examples:
            - Unit 19
        city:
          type:
            - string
            - 'null'
          maxLength: 100
          description: The city in which the address is located.
          examples:
            - Townsville
        region:
          type:
            - string
            - 'null'
          maxLength: 100
          description: The state or region in which the address is located.
          examples:
            - Louisiana
        postal_code:
          type:
            - string
            - 'null'
          maxLength: 16
          description: The postal code associated with the address.
          examples:
            - 90210
        country_code:
          type:
            - string
            - 'null'
          maxLength: 2
          description: The country code associated with the address.
          examples:
            - US
  securitySchemes:
    read:
      type: apiKey
      in: header
      name: X-Authorization
      description: 'API Scope: "Locations (read)"'
      x-scope: Locations (Read)

````