---
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/market/query-the-market-published-of-the-product'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/market/query-the-market-published-of-the-product.md'
---
# 查询商品在市场的发布状态

查询商品在指定国家或地区所对应市场的发布状态。

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

## Endpoint

```http
GET /markets/:product_id/published.json
```

## Base URL

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

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `read_products`

## Request

### Path Parameters

* `product_id`

  string (required)

  商品的唯一标识 ID。<br/>
  最大长度限制：64 

### Query Parameters

* `country_codes`

  string (required)

  遵循 [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) 国际标准的二位国家或地区码，用于识别市场所在的国家或地区。多个码用英文逗号分隔。最多支持 10 个码。

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

* `markets`

  array<object>

  所查询市场及对应的商品发布状态列表。

  * `country_code`

    string

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

  * `published`

    boolean

    商品是否在指定国家或地区对应的市场发布。
    - `true`：已发布
    - `false`：未发布


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "tags": [
    "查询商品在市场的发布状态"
  ],
  "description": "查询商品在指定国家或地区所对应市场的发布状态。",
  "externalDocs": {
    "description": "接口使用的权限点: `read_products` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "5ybIPYfh",
  "parameters": [
    {
      "name": "product_id",
      "in": "path",
      "description": "商品的唯一标识 ID。<br/>\n最大长度限制：64 ",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "product_id",
        "description": "商品的唯一标识 ID。<br/>\n最大长度限制：64 ",
        "type": "string",
        "example": "16049619743346320200470282"
      },
      "example": "16049619743346320200470282",
      "examples": {
        "查询商品在市场的发布状态": {
          "value": "16060895302856191591063144"
        }
      }
    },
    {
      "name": "country_codes",
      "in": "query",
      "description": "遵循 [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) 国际标准的二位国家或地区码，用于识别市场所在的国家或地区。多个码用英文逗号分隔。最多支持 10 个码。",
      "required": true,
      "style": "form",
      "explode": true,
      "schema": {
        "name": "country_codes",
        "description": "遵循 [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) 国际标准的二位国家或地区码，用于识别市场所在的国家或地区。多个码用英文逗号分隔。最多支持 10 个码。",
        "type": "string",
        "example": "CN,US"
      },
      "example": "CN,US",
      "examples": {
        "查询商品在市场的发布状态": {
          "value": "CN,US"
        }
      }
    },
    {
      "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": {
              "markets": {
                "name": "markets",
                "description": "所查询市场及对应的商品发布状态列表。",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "country_code": {
                      "name": "country_code",
                      "description": "遵循 [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) 国际标准的二位国家或地区码，用于识别市场所在的国家或地区。",
                      "type": "string",
                      "example": "US"
                    },
                    "published": {
                      "name": "published",
                      "description": "商品是否在指定国家或地区对应的市场发布。\n- `true`：已发布\n- `false`：未发布",
                      "type": "boolean"
                    }
                  },
                  "example": {
                    "country_code": "US",
                    "published": null
                  }
                },
                "example": [
                  {
                    "country_code": "US",
                    "published": null
                  }
                ]
              }
            },
            "example": {
              "markets": [
                {
                  "country_code": "US",
                  "published": null
                }
              ]
            }
          },
          "examples": {
            "查询商品在市场的发布状态": {
              "description": "查询商品在市场的发布状态。",
              "value": {
                "markets": [
                  {
                    "country_code": "CN",
                    "published": true
                  },
                  {
                    "country_code": "US",
                    "published": true
                  }
                ]
              }
            }
          }
        }
      }
    },
    "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": "/markets/:product_id/published.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_products"
  ]
}
```