---
title: "通过ID查询市场资源"
description: "根据market ID，查询市场"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/market/returns-a-market-resource-by-id'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/market/returns-a-market-resource-by-id.md'
---
# 通过ID查询市场资源

根据market ID，查询市场

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

## Endpoint

```http
GET /markets/:id.json
```

## Base URL

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

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

## Required Permissions

* `read_markets`

## Request

### Path Parameters

* `id`

  string (required)

  市场唯一标识

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

* `market`

  object

  市场信息

  * `enabled`

    boolean

    市场是否可用状态； true：启用； false：禁用；

  * `market_id`

    string

    市场唯一标识

  * `market_name`

    string

    市场的名称

  * `price_list`

    object

    商品价格信息

    * `parent`

      object

      相对价格的调整信息

      * `adjustment`

        object

        调整配置

  * `primary`

    boolean

    是否主要市场

  * `regions`

    array<object>

    国家信息

    * `code`

      string

      国家地区码

    * `currency`

      object

      币种信息

      * `currency_code`

        string

        币种

  * `web_presence`

    object

    url配置

    * `subfolder_suffix`

      string

      子文件夹特定后缀

    * `alternate_locales`

      array<string>

      备用区域

    * `default_locale`

      string

      默认区域

    * `root_urls`

      array<object>

      区域根url列表

      * `locale`

        string

        区域

      * `url`

        string

        地址

  * `currency_settings`

    object

    市场币种设置信息

    * `base_currency`

      object

      币种设置信息

      * `currency_code`

        string

        币种编码

      * `currency_name`

        string

        币种的名称

      * `exchange_rate`

        string

        汇率当 auto_exchange_rate= false时，才有值； 手动填写汇率值；

      * `rate_updated_at`

        string

        表示ISO 8601编码的日期和时间字符串。例如，UTC（协调世界时）时区的2019年9月7日下午3点50分表示为"2019-09-07T15:50:00Z“. 手动汇率，商家更新时间； 自动汇率，是系统更新的时间；

      * `auto_exchange_rate`

        boolean

        true：自动汇率； false：手动汇率；

    * `local_currencies`

      boolean

      是否启用本地币种


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "根据market ID，查询市场",
  "externalDocs": {
    "description": "接口使用的权限点: `read_markets` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "EamFoMdM",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "description": "市场唯一标识",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "id",
        "description": "市场唯一标识",
        "type": "string",
        "example": "2805657769119556579335"
      },
      "example": "2805657769119556579335"
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "style": "string",
      "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": {
            "type": "object",
            "properties": {
              "market": {
                "name": "market",
                "description": "市场信息",
                "type": "object",
                "properties": {
                  "enabled": {
                    "name": "enabled",
                    "description": "市场是否可用状态； true：启用； false：禁用；",
                    "type": "boolean",
                    "example": true
                  },
                  "market_id": {
                    "name": "market_id",
                    "description": "市场唯一标识",
                    "type": "string",
                    "example": "2805657769119556579334"
                  },
                  "market_name": {
                    "name": "market_name",
                    "description": "市场的名称",
                    "type": "string",
                    "example": "US-MARKET"
                  },
                  "price_list": {
                    "name": "price_list",
                    "description": "商品价格信息",
                    "type": "object",
                    "properties": {
                      "parent": {
                        "name": "parent",
                        "description": "相对价格的调整信息",
                        "type": "object",
                        "properties": {
                          "adjustment": {
                            "name": "adjustment",
                            "description": "调整配置",
                            "type": "object",
                            "properties": {
                              "type": {
                                "name": "type",
                                "description": "调整类型",
                                "type": "string",
                                "example": "PERCENTAGE_DECREASE"
                              },
                              "value": {
                                "name": "value",
                                "description": "百分比",
                                "type": "float",
                                "example": 10
                              }
                            },
                            "example": {
                              "type": "PERCENTAGE_DECREASE",
                              "value": 10
                            }
                          }
                        },
                        "example": {
                          "adjustment": {
                            "value": 10,
                            "type": "PERCENTAGE_DECREASE"
                          }
                        }
                      }
                    },
                    "example": {
                      "parent": {
                        "adjustment": {
                          "type": "PERCENTAGE_DECREASE",
                          "value": 10
                        }
                      }
                    }
                  },
                  "primary": {
                    "name": "primary",
                    "description": "是否主要市场",
                    "type": "boolean",
                    "example": true
                  },
                  "regions": {
                    "name": "regions",
                    "description": "国家信息",
                    "type": "array",
                    "items": {
                      "name": "regions",
                      "description": "国家信息",
                      "type": "object",
                      "properties": {
                        "code": {
                          "name": "code",
                          "description": "国家地区码",
                          "type": "string",
                          "example": "US"
                        },
                        "currency": {
                          "name": "currency",
                          "description": "币种信息",
                          "type": "object",
                          "properties": {
                            "currency_code": {
                              "name": "currency_code",
                              "description": "币种",
                              "type": "string",
                              "example": "USD"
                            }
                          },
                          "example": {
                            "currency_code": "USD"
                          }
                        }
                      },
                      "example": {
                        "code": "US",
                        "currency": {
                          "currency_code": "USD"
                        }
                      }
                    },
                    "example": [
                      {
                        "code": "US",
                        "currency": {
                          "currency_code": "USD"
                        }
                      }
                    ]
                  },
                  "web_presence": {
                    "name": "web_presence",
                    "description": "url配置",
                    "type": "object",
                    "properties": {
                      "subfolder_suffix": {
                        "name": "subfolder_suffix",
                        "description": "子文件夹特定后缀",
                        "type": "string",
                        "example": "suffix"
                      },
                      "alternate_locales": {
                        "name": "alternate_locales",
                        "description": "备用区域",
                        "type": "array",
                        "items": {
                          "name": "alternate_locales",
                          "description": "备用区域",
                          "type": "string",
                          "example": "[\"us\"]"
                        },
                        "example": [
                          "[\"us\"]"
                        ]
                      },
                      "default_locale": {
                        "name": "default_locale",
                        "description": "默认区域",
                        "type": "string",
                        "example": "us"
                      },
                      "root_urls": {
                        "name": "root_urls",
                        "description": "区域根url列表",
                        "type": "array",
                        "items": {
                          "name": "root_urls",
                          "description": "区域根url列表",
                          "type": "object",
                          "properties": {
                            "locale": {
                              "name": "locale",
                              "description": "区域",
                              "type": "string",
                              "example": "us"
                            },
                            "url": {
                              "name": "url",
                              "description": "地址",
                              "type": "string",
                              "example": "https://myshopline.com"
                            }
                          },
                          "example": {
                            "locale": "us",
                            "url": "https://myshopline.com"
                          }
                        },
                        "example": [
                          {
                            "locale": "us",
                            "url": "https://myshopline.com"
                          }
                        ]
                      }
                    },
                    "example": {
                      "root_urls": [
                        {
                          "locale": "us",
                          "url": "https://myshopline.com"
                        }
                      ],
                      "subfolder_suffix": "suffix",
                      "alternate_locales": [
                        "[\"us\"]"
                      ],
                      "default_locale": "us"
                    }
                  },
                  "currency_settings": {
                    "name": "currency_settings",
                    "description": "市场币种设置信息",
                    "type": "object",
                    "properties": {
                      "base_currency": {
                        "name": "base_currency",
                        "description": "币种设置信息",
                        "type": "object",
                        "properties": {
                          "currency_code": {
                            "name": "currency_code",
                            "description": "币种编码",
                            "type": "string",
                            "example": "USD"
                          },
                          "currency_name": {
                            "name": "currency_name",
                            "description": "币种的名称",
                            "type": "string",
                            "example": "USD"
                          },
                          "exchange_rate": {
                            "name": "exchange_rate",
                            "description": "汇率当 auto_exchange_rate= false时，才有值； 手动填写汇率值；",
                            "type": "string",
                            "example": "1.01234567891"
                          },
                          "rate_updated_at": {
                            "name": "rate_updated_at",
                            "description": "表示ISO 8601编码的日期和时间字符串。例如，UTC（协调世界时）时区的2019年9月7日下午3点50分表示为\"2019-09-07T15:50:00Z“. 手动汇率，商家更新时间； 自动汇率，是系统更新的时间；",
                            "type": "string",
                            "example": "2019-09-07T15:50:00Z"
                          },
                          "auto_exchange_rate": {
                            "name": "auto_exchange_rate",
                            "description": "true：自动汇率； false：手动汇率；",
                            "type": "boolean",
                            "example": true
                          }
                        },
                        "example": {
                          "auto_exchange_rate": true,
                          "currency_code": "USD",
                          "currency_name": "USD",
                          "exchange_rate": "1.01234567891",
                          "rate_updated_at": "2019-09-07T15:50:00Z"
                        }
                      },
                      "local_currencies": {
                        "name": "local_currencies",
                        "description": "是否启用本地币种",
                        "type": "boolean",
                        "example": true
                      }
                    },
                    "example": {
                      "base_currency": {
                        "currency_code": "USD",
                        "currency_name": "USD",
                        "exchange_rate": "1.01234567891",
                        "rate_updated_at": "2019-09-07T15:50:00Z",
                        "auto_exchange_rate": true
                      },
                      "local_currencies": true
                    }
                  }
                },
                "example": {
                  "price_list": {
                    "parent": {
                      "adjustment": {
                        "type": "PERCENTAGE_DECREASE",
                        "value": 10
                      }
                    }
                  },
                  "primary": true,
                  "regions": [
                    {
                      "code": "US",
                      "currency": {
                        "currency_code": "USD"
                      }
                    }
                  ],
                  "web_presence": {
                    "root_urls": [
                      {
                        "locale": "us",
                        "url": "https://myshopline.com"
                      }
                    ],
                    "subfolder_suffix": "suffix",
                    "alternate_locales": [
                      "[\"us\"]"
                    ],
                    "default_locale": "us"
                  },
                  "currency_settings": {
                    "local_currencies": true,
                    "base_currency": {
                      "exchange_rate": "1.01234567891",
                      "rate_updated_at": "2019-09-07T15:50:00Z",
                      "auto_exchange_rate": true,
                      "currency_code": "USD",
                      "currency_name": "USD"
                    }
                  },
                  "enabled": true,
                  "market_id": "2805657769119556579334",
                  "market_name": "US-MARKET"
                }
              }
            },
            "example": {
              "market": {
                "primary": true,
                "regions": [
                  {
                    "code": "US",
                    "currency": {
                      "currency_code": "USD"
                    }
                  }
                ],
                "web_presence": {
                  "alternate_locales": [
                    "[\"us\"]"
                  ],
                  "default_locale": "us",
                  "root_urls": [
                    {
                      "url": "https://myshopline.com",
                      "locale": "us"
                    }
                  ],
                  "subfolder_suffix": "suffix"
                },
                "currency_settings": {
                  "local_currencies": true,
                  "base_currency": {
                    "auto_exchange_rate": true,
                    "currency_code": "USD",
                    "currency_name": "USD",
                    "exchange_rate": "1.01234567891",
                    "rate_updated_at": "2019-09-07T15:50:00Z"
                  }
                },
                "enabled": true,
                "market_id": "2805657769119556579334",
                "market_name": "US-MARKET",
                "price_list": {
                  "parent": {
                    "adjustment": {
                      "type": "PERCENTAGE_DECREASE",
                      "value": 10
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "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/:id.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "通过ID查询市场资源",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_markets"
  ]
}
```