---
title: "查询地点列表"
description: "查询某个店铺下的所有地点。"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/product/inventory/location/get-locations'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/product/inventory/location/get-locations.md'
---
# 查询地点列表

查询某个店铺下的所有地点。

- **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` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `read_location`

## Request

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `locations`

  array<object>

  地点信息列表。

  * `address1`

    string

    地址的第一行。通常包含街道地址或邮政信箱编号等信息。

  * `country`

    string

    地址中的国家或区域。

  * `country_code`

    string

    国家或地区码。遵循 [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) 国际标准的二位国家或区域码，用于识别市场所在的国家或地区。

  * `id`

    string

    地点的唯一标识 ID。  
    

  * `phone_code`

    string

    电话号码国际区号。

  * `active`

    boolean

    地点是否启用。  
    - `true`: 启用  
    - `false`: 未启用

  * `address2`

    string

    地址的第二行。通常是公寓、套房或单元等信息。

  * `is_default`

    string

    是否默认地点，有效枚举值包含：
    - `true`：是默认地点
    - `false`：不是默认地点

  * `legacy`

    boolean

    是否履约应用地点。
    - `true`: 是履约应用地点
    - `false`: 不是履约应用地点

  * `city`

    string

    地址中的城市。

  * `created_at`

    string

    地点创建时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

  * `name`

    string

    地点名称。

  * `phone`

    string

    电话号码。

  * `province`

    string

    地址中的省份。

  * `province_code`

    string

    地址中省份的编码，该编码是系统自定义编号。

  * `updated_at`

    string

    地点更新时间。格式：[IOS 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

  * `zip`

    string

    地址的邮编信息。


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "tags": [
    "查询地点列表"
  ],
  "description": "查询某个店铺下的所有地点。",
  "externalDocs": {
    "description": "接口使用的权限点: `read_location` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "yOkvXsbT",
  "parameters": [
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "locations": {
                "name": "locations",
                "description": "地点信息列表。",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "address1": {
                      "name": "address1",
                      "description": "地址的第一行。通常包含街道地址或邮政信箱编号等信息。",
                      "type": "string"
                    },
                    "country": {
                      "name": "country",
                      "description": "地址中的国家或区域。",
                      "type": "string"
                    },
                    "country_code": {
                      "name": "country_code",
                      "description": "国家或地区码。遵循 [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) 国际标准的二位国家或区域码，用于识别市场所在的国家或地区。",
                      "type": "string"
                    },
                    "id": {
                      "name": "id",
                      "description": "地点的唯一标识 ID。  \n",
                      "type": "string"
                    },
                    "phone_code": {
                      "name": "phone_code",
                      "description": "电话号码国际区号。",
                      "type": "string"
                    },
                    "active": {
                      "name": "active",
                      "description": "地点是否启用。  \n- `true`: 启用  \n- `false`: 未启用",
                      "type": "boolean"
                    },
                    "address2": {
                      "name": "address2",
                      "description": "地址的第二行。通常是公寓、套房或单元等信息。",
                      "type": "string"
                    },
                    "is_default": {
                      "name": "is_default",
                      "description": "是否默认地点，有效枚举值包含：\n- `true`：是默认地点\n- `false`：不是默认地点",
                      "type": "string"
                    },
                    "legacy": {
                      "name": "legacy",
                      "description": "是否履约应用地点。\n- `true`: 是履约应用地点\n- `false`: 不是履约应用地点",
                      "type": "boolean"
                    },
                    "city": {
                      "name": "city",
                      "description": "地址中的城市。",
                      "type": "string"
                    },
                    "created_at": {
                      "name": "created_at",
                      "description": "地点创建时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
                      "type": "string"
                    },
                    "name": {
                      "name": "name",
                      "description": "地点名称。",
                      "type": "string"
                    },
                    "phone": {
                      "name": "phone",
                      "description": "电话号码。",
                      "type": "string"
                    },
                    "province": {
                      "name": "province",
                      "description": "地址中的省份。",
                      "type": "string"
                    },
                    "province_code": {
                      "name": "province_code",
                      "description": "地址中省份的编码，该编码是系统自定义编号。",
                      "type": "string"
                    },
                    "updated_at": {
                      "name": "updated_at",
                      "description": "地点更新时间。格式：[IOS 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
                      "type": "string"
                    },
                    "zip": {
                      "name": "zip",
                      "description": "地址的邮编信息。",
                      "type": "string"
                    }
                  },
                  "example": {
                    "phone_code": null,
                    "zip": null,
                    "address2": null,
                    "id": null,
                    "phone": null,
                    "province_code": null,
                    "active": null,
                    "country_code": null,
                    "city": null,
                    "country": null,
                    "name": null,
                    "province": null,
                    "updated_at": null,
                    "address1": null,
                    "created_at": null,
                    "is_default": null,
                    "legacy": null
                  }
                },
                "example": [
                  {
                    "phone_code": null,
                    "active": null,
                    "address2": null,
                    "city": null,
                    "id": null,
                    "province": null,
                    "zip": null,
                    "phone": null,
                    "address1": null,
                    "country": null,
                    "created_at": null,
                    "is_default": null,
                    "legacy": null,
                    "updated_at": null,
                    "country_code": null,
                    "province_code": null,
                    "name": null
                  }
                ]
              }
            },
            "example": {
              "locations": [
                {
                  "active": null,
                  "address2": null,
                  "id": null,
                  "name": null,
                  "phone": null,
                  "province_code": null,
                  "city": null,
                  "country": null,
                  "legacy": null,
                  "province": null,
                  "updated_at": null,
                  "address1": null,
                  "phone_code": null,
                  "country_code": null,
                  "created_at": null,
                  "is_default": null,
                  "zip": null
                }
              ]
            }
          },
          "examples": {
            "查询地点列表": {
              "description": "查询某个店铺下的所有地点。",
              "value": {
                "locations": [
                  {
                    "phone_code": "+1",
                    "province": "California",
                    "province_code": "CA",
                    "city": "Los Angeles",
                    "country": "United States",
                    "country_code": "US",
                    "is_default": "false",
                    "legacy": "false",
                    "name": "Tom",
                    "created_at": "2023-03-22T10:15:00Z",
                    "phone": "0013101231234",
                    "zip": "90001",
                    "active": "true",
                    "address1": "456 Oak Avenue",
                    "address2": "ABC",
                    "id": "***************61850",
                    "updated_at": "2023-07-05T09:20:00Z"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "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` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "查询地点列表",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_location"
  ]
}
```