商品详情 #

描述 #

使用此接口获取商品详细信息。

接口说明 #

授权对象 APP

请求地址 GET /open/cps/goodsDetail

请求规则 请查阅开发必读

请求参数 #

参数名称 变量名称 参数类型[长度限制] 是否必填 描述
商品ID id uint32 query

示例值:1001

商户ID merchant_id uint32 query

示例值:12345

订单类型 order_type int32 query0:打包 3:堂食

示例值:0

请求示例 #

{
  "id": 1001,
  "merchant_id": 12345,
  "order_type": 0
}

响应参数 #

参数名称 变量名称 参数类型 是否必填 描述
商品信息 info object 商品基本信息
规格列表 attr_list object[] 商品规格列表
SKU列表 sku_list object[] 商品SKU列表
加料列表 attach_list object[] 商品加料列表

商品信息 info #

参数名称 变量名称 参数类型 是否必填 描述
商品ID id uint32

示例值:1001

商品标题 title string

示例值:不二云微奶茶

商品图片 thumb string

示例值:https://bool.dev/images/products/milk-tea.jpg

商品描述 describe string

示例值:精选茶底,搭配香浓奶精,口感丝滑

商品价格 price double

示例值:24

商品类型 is_type int32 1:单规格 2:多规格

示例值:1

商品类型 types uint32 0 平台商品 其他皆为开发平台商品cps_mch_id

示例值:1

包装费 box_fee double

示例值:1.5

库存 inventory uint32

示例值:100

库存限制 limit int32 1 限制库存(库存为0 则售罄) 2 不限库存

示例值:1

商品详细 content string

示例值:商品详细介绍

商品图片列表 images string[]

示例值:["https://example.com/image1.jpg", "https://example.com/image2.jpg"]

是否推荐 is_recommend int32 0:否 1:是

示例值:1

是否热门 is_hot int32 0:否 1:是

示例值:1

是否新品 is_new int32 0:否 1:是

示例值:1

活动商品 goods_activity bool

示例值:false

活动类型 goods_activity_types int32

示例值:2

活动折扣 goods_activity_discount double

示例值:0.9

原价 original_price double

示例值:27

单次限购 order_limit uint32

示例值:5

原材料列表 raw_material_list string[]

示例值:["茶叶", "奶精"]

重量 weight double 单位:克

示例值:500

加料材料 attach_material string[]

示例值:["珍珠", "椰果"]

起始数量 start_num uint32

示例值:1

步长 unit_num uint32

示例值:1

推荐理由 reason string

示例值:商品缺货

视频 video string

示例值:https://example.com/video.mp4

单点不送 single_limit int32

示例值:3

会员价 vip_price double

示例值:22

会员类型 vip_type int32 0:无 1:超级会员 2:企微 3:群友价

示例值:1

单位 unit string

示例值:杯

限购数量 limit_num uint32

示例值:10

限购类型 limit_type uint32

示例值:1

活动价 activity_price double

示例值:21.5

规格信息 attr_list #

参数名称 变量名称 参数类型 是否必填 描述
规格ID id int64

示例值:1

规格名称 title string

示例值:杯型

排序 sort uint32

示例值:1

规格类型 types int32 1表示规格

示例值:1

规格值列表 values object[] 规格值列表

规格值信息 values #

参数名称 变量名称 参数类型 是否必填 描述
规格值ID id int64

示例值:101

规格值名称 title string

示例值:大杯

排序 sort uint32

示例值:1

加料信息 attach_list #

参数名称 变量名称 参数类型 是否必填 描述
加料ID id int64

示例值:2

加料名称 title string

示例值:加料

排序 sort uint32

示例值:1

加料类型 types int32 2表示加料

示例值:2

加料值列表 values object[] 加料值列表
最大数量 max uint32 最多可选几种加料

示例值:3

单选 radio int32 1表示单选,2表示多选

示例值:1

加料值信息 values #

参数名称 变量名称 参数类型 是否必填 描述
加料值ID id int64

示例值:201

加料值名称 title string

示例值:珍珠

排序 sort uint32

示例值:1

加价价格 price double

示例值:1

SKU信息 sku_list #

参数名称 变量名称 参数类型 是否必填 描述
SKU ID id int64

示例值:2001

规格值ID列表 ids int64[]

示例值:[101, 102]

库存 inventory uint32

示例值:50

价格 price double

示例值:24

规格名称 standard string

示例值:大杯

图片 images string

示例值:https://bool.dev/images/products/latte-large.jpg

是否禁用 disable bool

示例值:false

原价 original_price double

示例值:27

是否参与活动 goods_activity bool

示例值:false

重量 weight double 单位:克

示例值:500

库存限制 limit int32 1 限制库存(库存为0 则售罄) 2 不限库存

示例值:1

起始数量 start_num uint32

示例值:1

步长 unit_num uint32

示例值:1

限购数量 limit_num uint32

示例值:10

限购类型 limit_type uint32

示例值:1

单次限购 order_limit uint32

示例值:5

活动类型 goods_activity_types int32

示例值:1

活动折扣 goods_activity_discount double

示例值:0.9

响应示例 #

{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 1001,
    "title": "不二云微奶茶",
    "thumb": "https://bool.dev/images/products/milk-tea.jpg",
    "description": "精选茶底,搭配香浓奶精,口感丝滑",
    "price": 18,
    "original_price": 20,
    "sales": 2000,
    "inventory": 100,
    "status": 1,
    "is_type": 2,
    "attr_list": [
      {
        "id": 1,
        "title": "杯型",
        "sort": 1,
        "types": 1,
        "values": [
          {
            "id": 101,
            "title": "大杯",
            "sort": 1
          },
          {
            "id": 102,
            "title": "中杯",
            "sort": 2
          }
        ]
      },
      {
        "id": 2,
        "title": "茶底",
        "sort": 2,
        "types": 1,
        "values": [
          {
            "id": 201,
            "title": "阿萨姆红茶",
            "sort": 1
          },
          {
            "id": 202,
            "title": "乌龙茶",
            "sort": 2
          },
          {
            "id": 203,
            "title": "四季春茶",
            "sort": 3
          }
        ]
      }
    ],
    "attach_list": [
      {
        "id": 3,
        "title": "加料",
        "sort": 1,
        "types": 2,
        "values": [
          {
            "id": 301,
            "title": "珍珠",
            "sort": 1,
            "price": 2
          },
          {
            "id": 302,
            "title": "椰果",
            "sort": 2,
            "price": 2
          },
          {
            "id": 303,
            "title": "布丁",
            "sort": 3,
            "price": 3
          }
        ],
        "max": 3,
        "radio": 2
      }
    ],
    "sku_list": [
      {
        "id": 2001,
        "ids": [101, 201],
        "inventory": 50,
        "price": 22,
        "standard": "大杯+阿萨姆红茶",
        "images": "https://bool.dev/images/products/large-assam.jpg",
        "disable": false,
        "original_price": 25,
        "goods_activity": false,
        "cost_price": 12,
        "weight": 500,
        "limit": 1,
        "start_num": 1,
        "unit_num": 1,
        "limit_num": 10,
        "limit_type": 1,
        "order_limit": 5,
        "goods_activity_types": 1,
        "goods_activity_discount": 0.9
      },
      {
        "id": 2002,
        "ids": [101, 202],
        "inventory": 50,
        "price": 24,
        "standard": "大杯+乌龙茶",
        "images": "https://bool.dev/images/products/large-oolong.jpg",
        "disable": false,
        "original_price": 27,
        "goods_activity": false,
        "cost_price": 13,
        "weight": 500,
        "limit": 1,
        "start_num": 1,
        "unit_num": 1,
        "limit_num": 10,
        "limit_type": 1,
        "order_limit": 5,
        "goods_activity_types": 1,
        "goods_activity_discount": 0.9
      },
      {
        "id": 2003,
        "ids": [101, 203],
        "inventory": 50,
        "price": 26,
        "standard": "大杯+四季春茶",
        "images": "https://bool.dev/images/products/large-spring.jpg",
        "disable": false,
        "original_price": 29,
        "goods_activity": false,
        "cost_price": 14,
        "weight": 500,
        "limit": 1,
        "start_num": 1,
        "unit_num": 1,
        "limit_num": 10,
        "limit_type": 1,
        "order_limit": 5,
        "goods_activity_types": 1,
        "goods_activity_discount": 0.9
      },
      {
        "id": 2004,
        "ids": [102, 201],
        "inventory": 50,
        "price": 18,
        "standard": "中杯+阿萨姆红茶",
        "images": "https://bool.dev/images/products/medium-assam.jpg",
        "disable": false,
        "original_price": 20,
        "goods_activity": false,
        "cost_price": 10,
        "weight": 400,
        "limit": 1,
        "start_num": 1,
        "unit_num": 1,
        "limit_num": 10,
        "limit_type": 1,
        "order_limit": 5,
        "goods_activity_types": 1,
        "goods_activity_discount": 0.9
      },
      {
        "id": 2005,
        "ids": [102, 202],
        "inventory": 50,
        "price": 20,
        "standard": "中杯+乌龙茶",
        "images": "https://bool.dev/images/products/medium-oolong.jpg",
        "disable": false,
        "original_price": 22,
        "goods_activity": false,
        "cost_price": 11,
        "weight": 400,
        "limit": 1,
        "start_num": 1,
        "unit_num": 1,
        "limit_num": 10,
        "limit_type": 1,
        "order_limit": 5,
        "goods_activity_types": 1,
        "goods_activity_discount": 0.9
      },
      {
        "id": 2006,
        "ids": [102, 203],
        "inventory": 50,
        "price": 22,
        "standard": "中杯+四季春茶",
        "images": "https://bool.dev/images/products/medium-spring.jpg",
        "disable": false,
        "original_price": 24,
        "goods_activity": false,
        "cost_price": 12,
        "weight": 400,
        "limit": 1,
        "start_num": 1,
        "unit_num": 1,
        "limit_num": 10,
        "limit_type": 1,
        "order_limit": 5,
        "goods_activity_types": 1,
        "goods_activity_discount": 0.9
      }
    ]
  }
}
上次更新: 2/21/2025, 3:53:48 PM