Fecify-店铺-创建

接口信息

  • 接口地址: {your-site-url}/api/skill/shop/create
  • 基础 URL: {your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/admin
  • 请求方式: POST
  • Content-Type: application/json
  • 说明: 创建新店铺。创建成功后系统自动分配域名,返回店铺完整信息。

认证

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

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

请求参数

字段 类型 必填 说明
name String 是 店铺名称
main_manager_id Number 是 店铺主账号 ID,通过 Fecify-店铺用户-select下拉条 得到用户ID,也可以通过:Fecify-正常用户-列表 中的 id
status Number 是 店铺状态:1 = 激活,2 = 关闭
type Number 是 店铺类型:10 = B2C,20 = B2B。通过 Fecify店铺类型列表 获取有效值
product_max_count Number 是 商品创建的最大数量,0 = 无限制
is_not_expire Number 是 过期类型:1 = 永不过期,2 = 指定过期时间
expired_at String 否 过期时间,格式 YYYY-MM-DD HH:mm:ss;is_not_expire=2 时必填
package_id Number 是 套餐 ID,通过 店铺-套餐列表 获取可用套餐

请求示例

cURL

curl --location --request POST '{your-site-url}/api/skill/shop/create' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "terry test",
    "main_manager_id": 141,
    "status": 1,
    "type": 10,
    "product_max_count": 0,
    "is_not_expire": 1,
    "expired_at": "",
    "package_id": 10
}'

返回结果

code 为 200 表示创建成功;code 不为 200 表示失败。

成功响应

{
    "code": 200,
    "data": {
        "main_manager_id": 141,
        "name": "terry test",
        "status": 1,
        "product_max_count": 0,
        "type": 10,
        "expired_at": "2026-07-21 14:03:07",
        "is_not_expire": 1,
        "package_id": 10,
        "https": 1,
        "domain": "84b96f9b85.fecmall.cn",
        "created_at": "2026-07-21 14:03:07",
        "updated_at": "2026-07-21 14:03:07",
        "id": 353
    },
    "message": "success"
}

返回字段说明

字段 类型 说明
code Number 状态码,200 表示成功
message String 执行结果的文字描述
data Object 创建后的店铺信息,字段含义与 店铺-详细 返回字段一致

异常响应

场景 code message
package_id 为空或套餐不存在 100300029 `套餐信息错误 \ package id is empty`
店铺类型系统不支持 100300022 店铺类型错误,系统不支持
超出最大店铺数 100300021 已超出最大店铺个数
创建失败 100300001 店铺创建失败

实测创建成功返回 id、自动生成的 domain 及 https=1。

注意事项

  1. type 需使用 Fecify店铺类型列表 中 status=true 的类型 code 值。
  2. 创建成功后系统自动生成域名(domain),并默认开启 HTTPS(https=1)。
  3. 返回字段详见 店铺-详细。

results matching ""

    No results matching ""