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

# Get Locations

> This endpoint will return all accessible location records

This endpoint can be used to fetch the IDs of all locations that are currently
accessible to the integration partner.

<RequestExample>
  ```bash Get Merchants theme={null}
  curl https://api.thanxsandbox.com/partner/locations \
    -H 'X-ClientId: ${client_id}' \
    -H 'Accept-Version: v4.0' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer ${access_token}' \
  ```
</RequestExample>

### Parameters

<ParamField path="merchant_id" type="string" optional>
  Filter by Merchant ID
</ParamField>

<Snippet file="pagination/params.mdx" />

### Response

<ResponseField name="id" type="string">
  Location ID
</ResponseField>

<ResponseField name="merchant_id" type="string">
  Merchant ID
</ResponseField>

<ResponseField name="street" type="string">
  Location's street address
</ResponseField>

<ResponseField name="city" type="string">
  Location's city
</ResponseField>

<ResponseField name="state" type="string">
  Location's state
</ResponseField>

<ResponseField name="zip" type="string">
  Location's zip code
</ResponseField>

<ResponseField name="name" type="string">
  The name of the location if it has one
</ResponseField>

<ResponseField name="phone" type="string">
  The phone number of the location
</ResponseField>

<Snippet file="pagination/response.mdx" />

<ResponseExample>
  ```json Response Example theme={null}
  {
    "locations": [
      {
        "id": "92b7b0dac4",
        "merchant_id": "9a1f0772c9ac",
        "street": "123 Pizza Lane",
        "city": "Smalltown",
        "state": "CA",
        "zip": "12345",
        "name": "Pizza Town Co",
        "phone": "(415) 555-3728"
      }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 10,
      "total_pages":  1
    }
  }
  ```
</ResponseExample>
