基础 - 获取国家和省列表

接口信息

  • 接口地址: {your-site-url}/api/skill/base/get-country-list
  • 基础 URL: {your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/apimanager666
  • 请求方式: GET
  • 说明: 此接口用于获取系统支持的国家列表及省份数据,用于订单结账页收货地址的国家/省份选择

认证

请求头中需要携带 skill-access-token

Header
skill-access-token {your-skill-access-token} (请替换为你自己的 token)

请求参数

无需传参。


请求示例

cURL

curl --location --request GET '{your-site-url}/api/skill/base/get-country-list' \
--header 'skill-access-token: {your-skill-access-token}' \
--data-raw ''

返回结果

code200 表示调用成功;code 不为 200 表示调用失败。

成功响应

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "code": "AF",
            "name": "Afghanistan",
            "provinces": []
        },
        {
            "id": 43,
            "code": "CN",
            "name": "China",
            "provinces": [
                {
                    "id": 88,
                    "code": "AH",
                    "name": "AnHui",
                    "country_code": "CN"
                }
            ]
        }
    ],
    "message": "success"
}

返回字段说明

字段 类型 说明
code Number 状态码,200 表示成功
message String 执行结果的文字描述
data Array[Object] 国家列表

data 子项字段

字段 类型 说明
id int 国家记录 ID
code string 国家代码(ISO 3166-1 alpha-2),用于国家设置中 countryssorts 参数
name string 国家名称(英文)
provinces Array[Object] 省份/州列表,无省份时为空数组 []

provinces 子项字段

字段 类型 说明
id int 省份记录 ID
code string 省份代码
name string 省份名称(英文)
country_code string 所属国家代码

注意事项

  1. GET 请求,无需传参
Copyright © fecify.com 2025 all right reserved,powered by Gitbook该文件修订时间: 2026-05-30 09:50:30

results matching ""

    No results matching ""