智简魔方文档

GET 商品详情

接口概览

项目内容
文档类型后台接口
请求方式GET
接口地址/DIR_ADMIN/v1/product/{id}
所属业务商品管理
来源模块/系统商品管理
认证方式Bearer Token(管理员令牌)

完整请求

请求

bash
正在加载示例…

失败请求

bash
正在加载示例…

接口说明

商品详情

请求参数

名称位置类型必选说明
idpathinteger(int32)是商品 ID

成功响应

json
正在加载示例…

失败响应 400:请求参数或业务校验失败

json
正在加载示例…

失败响应 401:未认证或登录已失效

json
正在加载示例…

失败响应 403:无权执行当前操作

json
正在加载示例…

失败响应 404:接口或业务资源不存在

json
正在加载示例…

失败响应 500:服务器内部错误

json
正在加载示例…

响应状态

状态码状态码含义说明数据模型
200OK成功响应内联对象
400Bad Request请求参数或业务校验失败内联对象
401Unauthorized未认证或登录已失效内联对象
403Forbidden无权执行当前操作内联对象
404Not Found接口或业务资源不存在内联对象
500Internal Server Error服务器内部错误内联对象

响应参数

状态码 200

名称类型必选约束说明
statusinteger(int32)否—状态码
msgstring否—提示信息
dataobject否——
data.productobject否—商品
data.product.idinteger(int32)否—ID
data.product.namestring否—商品名称
data.product.product_group_idinteger(int32)否—所属商品组 ID
data.product.descriptionstring否—商品描述
data.product.hiddeninteger(int32)否—是否隐藏 0显示 1隐藏
data.product.stock_controlinteger(int32)否—库存控制 1启用 0关闭
data.product.qtyinteger(int32)否—库存数量
data.product.product_idinteger(int32)否—父商品 ID
data.product.plugin_custom_fields[string]否—自定义字段
data.product.showinteger(int32)否—是否展示在会员中心 0否 1是
data.product.renew_rulestring否—续费规则 due到期日 current当前时间
data.product.auto_renew_in_advanceinteger(int32)否—自动续费提前开关 0关闭 1开启
data.product.auto_renew_in_advance_numinteger(int32)否—自动续费提前时间数
data.product.auto_renew_in_advance_unitstring否—自动续费提前时间单位 minute分钟 hour小时 day天
data.product.natural_month_prepaidinteger(int32)否—自然月预付费开关 0关闭 1开启
data.product.recommendinteger(int32)否—推荐开关 0关闭 1开启
data.product.recommend_textstring否—推荐文案
data.product.recommend_colorstring否—推荐标签颜色 HEX格式如#FF5733
data.product.sync_stockinteger(int32)否——
data.product.pay_typestring否——
data.product.auto_setupinteger(int32)否——
data.product.typestring否——
data.product.rel_idinteger(int32)否——
data.product.pricestring否——
data.product.cyclestring否——
data.product.show_base_infointeger(int32)否——
data.product.pay_ontrial[任意类型]否——
data.product.upgrade[任意类型]否——
data.product.product_group_id_firstinteger(int32)否——
data.product.modulestring否——
data.modestring否—代理模式 only_api仅调用接口 sync同步商品
data.supplier_namestring否—供应商名称
data.profit_typeinteger(int32)否—利润类型 0百分比价格方案 1自定义金额
data.show_base_infointeger(int32)否—产品列表是否展示基础信息 1是 0否
data.modulestring否—商品对应模块
data.plugin_custom_fieldsobject否—插件钩子返回的自定义字段
data.pay_ontrialobject否—试用配置
data.pay_ontrial.statusinteger(int32)否—是否开启
data.pay_ontrial.cycle_typestring否—时长单位 hour day month
data.pay_ontrial.cycle_numinteger(int32)否—时长
data.pay_ontrial.client_limitstring否—用户限制 no不限制 new新用户 host用户必须存在激活中的产品
data.pay_ontrial.account_limitstring否—账户限制 email绑定邮件 phone绑定手机 certification实名
data.pay_ontrial.old_client_exclusivestring否—老用户专享商品 ID 逗号分隔
data.pay_ontrial.maxinteger(int32)否—单用户最大试用数量

失败状态码 400、401、403、404、500 共用以下结构:

名称类型必选约束说明
statusinteger(int32)是—错误状态码
msgstring是—错误提示