---
title: "Get locations"
description: "Get all locations for a store."
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/product/inventory/location/get-locations'
  md: 'https://developer.shopline.com/docs/admin-rest-api/product/inventory/location/get-locations.md'
---
# Get locations

Get all locations for a store.

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `read_location`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
GET /locations/list.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `read_location`

## Request

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `locations`

  array<object>

  Location information list.

  * `active`

    boolean

    Whether the location is enabled.
    - `true`: enabled
    - `false`: disabled

  * `name`

    string

    Location name.

  * `phone`

    string

    Phone number.

  * `updated_at`

    string

    The date and time when the location was updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `address2`

    string

    The second line of the address. This typically includes information such as apartment, suite, or unit number.

  * `country`

    string

    The country or region in the address.

  * `created_at`

    string

    The date and time when the location was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `phone_code`

    string

    The international dialing code for the phone number.

  * `province_code`

    string

    The code for the province in the address, which is a system custom code.

  * `address1`

    string

    The first line of the address. This typically includes information such as the street address or a post office box number.

  * `city`

    string

    The city in the address.

  * `country_code`

    string

    A two-letter country or region code that follows the [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) standard, used to identify a specific country or region in the address.

  * `is_default`

    string

    Whether it is the default location. Valid values are: 
    - `true`: default location
    - `false`: not a default location

  * `province`

    string

    The province in the address.

  * `id`

    string

    The unique identifier for the location.  
    

  * `legacy`

    boolean

    Whether it is a fulfillment app location.
    - `true`: Is a fulfillment app location.
    - `false`: Is not a fulfillment app location.

  * `zip`

    string

    The postal code information of the address.


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "tags": [
    "Get locations"
  ],
  "description": "Get all locations for a store.",
  "externalDocs": {
    "description": "Permission point used by the interface is `read_location` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "yOkvXsbT",
  "parameters": [
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "locations": {
                "name": "locations",
                "description": "Location information list.",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "active": {
                      "name": "active",
                      "description": "Whether the location is enabled.\n- `true`: enabled\n- `false`: disabled",
                      "type": "boolean"
                    },
                    "name": {
                      "name": "name",
                      "description": "Location name.",
                      "type": "string"
                    },
                    "phone": {
                      "name": "phone",
                      "description": "Phone number.",
                      "type": "string"
                    },
                    "updated_at": {
                      "name": "updated_at",
                      "description": "The date and time when the location was updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string"
                    },
                    "address2": {
                      "name": "address2",
                      "description": "The second line of the address. This typically includes information such as apartment, suite, or unit number.",
                      "type": "string"
                    },
                    "country": {
                      "name": "country",
                      "description": "The country or region in the address.",
                      "type": "string"
                    },
                    "created_at": {
                      "name": "created_at",
                      "description": "The date and time when the location was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string"
                    },
                    "phone_code": {
                      "name": "phone_code",
                      "description": "The international dialing code for the phone number.",
                      "type": "string"
                    },
                    "province_code": {
                      "name": "province_code",
                      "description": "The code for the province in the address, which is a system custom code.",
                      "type": "string"
                    },
                    "address1": {
                      "name": "address1",
                      "description": "The first line of the address. This typically includes information such as the street address or a post office box number.",
                      "type": "string"
                    },
                    "city": {
                      "name": "city",
                      "description": "The city in the address.",
                      "type": "string"
                    },
                    "country_code": {
                      "name": "country_code",
                      "description": "A two-letter country or region code that follows the [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) standard, used to identify a specific country or region in the address.",
                      "type": "string"
                    },
                    "is_default": {
                      "name": "is_default",
                      "description": "Whether it is the default location. Valid values are: \n- `true`: default location\n- `false`: not a default location",
                      "type": "string"
                    },
                    "province": {
                      "name": "province",
                      "description": "The province in the address.",
                      "type": "string"
                    },
                    "id": {
                      "name": "id",
                      "description": "The unique identifier for the location.  \n",
                      "type": "string"
                    },
                    "legacy": {
                      "name": "legacy",
                      "description": "Whether it is a fulfillment app location.\n- `true`: Is a fulfillment app location.\n- `false`: Is not a fulfillment app location.",
                      "type": "boolean"
                    },
                    "zip": {
                      "name": "zip",
                      "description": "The postal code information of the address.",
                      "type": "string"
                    }
                  },
                  "example": {
                    "created_at": null,
                    "id": null,
                    "is_default": null,
                    "phone_code": null,
                    "country_code": null,
                    "city": null,
                    "name": null,
                    "phone": null,
                    "legacy": null,
                    "province": null,
                    "province_code": null,
                    "updated_at": null,
                    "zip": null,
                    "active": null,
                    "address1": null,
                    "address2": null,
                    "country": null
                  }
                },
                "example": [
                  {
                    "active": null,
                    "address1": null,
                    "address2": null,
                    "legacy": null,
                    "id": null,
                    "name": null,
                    "phone": null,
                    "zip": null,
                    "country_code": null,
                    "created_at": null,
                    "province": null,
                    "updated_at": null,
                    "city": null,
                    "country": null,
                    "is_default": null,
                    "phone_code": null,
                    "province_code": null
                  }
                ]
              }
            },
            "example": {
              "locations": [
                {
                  "address2": null,
                  "created_at": null,
                  "active": null,
                  "address1": null,
                  "country_code": null,
                  "is_default": null,
                  "phone": null,
                  "phone_code": null,
                  "zip": null,
                  "id": null,
                  "legacy": null,
                  "name": null,
                  "province_code": null,
                  "updated_at": null,
                  "province": null,
                  "city": null,
                  "country": null
                }
              ]
            }
          },
          "examples": {
            "Get location list": {
              "description": "Get all locations for a store.",
              "value": {
                "locations": [
                  {
                    "address2": "ABC",
                    "name": "Tom",
                    "province": "California",
                    "phone_code": "+1",
                    "address1": "456 Oak Avenue",
                    "created_at": "2023-03-22T10:15:00Z",
                    "id": "***************61850",
                    "is_default": "false",
                    "updated_at": "2023-07-05T09:20:00Z",
                    "zip": "90001",
                    "legacy": "false",
                    "phone": "0013101231234",
                    "active": "true",
                    "city": "Los Angeles",
                    "country": "United States",
                    "country_code": "US",
                    "province_code": "CA"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "get",
  "path": "/locations/list.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Get locations",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_location"
  ]
}
```