大昌行大昌行
关于对接
免登陆
  • 签名/验签
  • 订单
  • 商品
  • 会员
  • 积分
  • 余额
收银台
关于对接
免登陆
  • 签名/验签
  • 订单
  • 商品
  • 会员
  • 积分
  • 余额
收银台
  • 商品

商品

获取商品

请求

  • 请求方法:
  • 请求URL: https://domain.com/addons/yun_shop/api.php?route=plugin.third-sync.open.goods

请求参数

示例
{
    "i" : 1,
    "page" : 1,
    "page_size" : 10,
    "query": {
        "ids": [5],
        "not_in_ids": [5],
        "title": "测试商品",
        "needOptions": true,
        "timestamp_range": [
            1736438400,
            1738252800
        ]
    },
	"order_by": {
		"id": "asc", // 正序
		"created_at": "desc", // 倒叙
	},
    "body": {
        "str_no": "mRJ8XG1oYImszwkODs4mecHdqyuRUmp7",
        "source": "dch-xfh",
        "timestamp": "1737017595"
    },
    "sign_type": "MD5",
    "sign": "c09534ebc577a05fddcefd3edde8da65"
}
参数解析
参数名类型必填描述
iint是站点唯一值
pageint否当前分页值
page_sizeint否当前分页数量 (默认10)
queryobject否查询
order_byobject否排序
bodyobject是只加签body里面的参数
sign_typestring是固定值 'MD5'
signstring是验签参数

query

参数名类型必填描述
needOptionsbool否是否展示商品规格
titlestring否商品名称
idsarray(int)否id数组集合
not_in_idsarray(int)否id数组集合
timestamp_rangearray否按照创建时间范围搜索 (时间使用秒级时间戳)

order_by

注: asc 正序, desc 倒序

参数名类型必填描述
idstring否商品ID
created_atstring否创建时间
display_orderstring否原排序字段
pricestring否现价
cost_pricestring否成本价
market_pricestring否市场价

body

参数名类型必填描述
str_nostring是随机字符串32位之内, 数字 + 大小写字母组合
sourcestring是来源,由提供方发放的标识
timestampint是时间戳

响应和参数

  • 响应格式: application/json

示例

{
	"result": 1,
	"msg": "ok",
	"data": {
		"current_page": 1,
		"data": [
			{
				"id": 5,
				"uniacid": 1,
				"status": 1,
				"display_order": 100,
				"title": "测试商品测试商品测试商品测试商品测试商品测试商品",
				"thumb": "http://localhost:8000/static/upload/newimage/2e47887207499205182a44db24d9cd0a.jpg",
				"sku": "个",
				"description": "",
				"goods_sn": "SPBM000000001",
				"product_sn": "SPTM000000002",
				"market_price": "15.00",
				"price": "10.00",
				"cost_price": "5.00",
				"stock": 9999999,
				"reduce_stock_method": 0,
				"show_sales": 0,
				"real_sales": 33,
				"weight": "180.00",
				"is_new": 0,
				"is_hot": 1,
				"is_discount": 0,
				"is_recommand": 1,
				"is_comment": 0,
				"created_at": "2025-01-16 21:28:55",
				"updated_at": "2025-01-16 21:31:55",
				"plugin_id": 0,
				"virtual_sales": 9999999,
				"need_address": 0,
				"type2": 1,
				"alias": "测试商品-商品简称",
				"status_name": "上架",
				"has_many_options": [
					{
						"id": 1,
						"uniacid": 1,
						"goods_id": 5,
						"title": "规格值1",
						"thumb": "",
						"product_price": "15.00",
						"market_price": "10.00",
						"cost_price": "5.00",
						"stock": 9999,
						"weight": "0.00",
						"display_order": 0,
						"specs": "1",
						"skuId": "",
						"goods_sn": "SPBM00001",
						"product_sn": "SPTM00001",
						"virtual": 0,
						"red_price": "",
						"volume": "0.000"
					}
				]
			},
		],
		"next_page_url": null,
		"path": "http://localhost:8000/addons/yun_shop/api.php",
		"per_page": 15,
		"prev_page_url": null,
		"to": 4,
		"total": 4
	}
}

完整返回主体

参数名类型描述
resultbool结果 0 失败, 1成功
msgbool信息
dataobject商品分页数据

商品分页

参数名类型描述
current_pageint当前页码
per_pageint每页条数
dataobject商品数据
toint当前页返回条数
totalint总数量

商品数据

参数名类型描述
idintid
uniacidint站点唯一值
statusint状态
display_orderint排序
titlestring商品全称
thumbstring主图地址
skustring单位 个/件/包
descriptionstring商品描述
goods_snstring商品编码
product_snstring商品条码
market_pricestring(decimal)市场价
pricestring(decimal)现价
cost_pricestring(decimal)成本价
stockint库存
reduce_stock_methodint扣库存方式0下单1付款2永不
show_salesint销量
real_salesint实际销量
weightstring(decimal)商品重量
is_newint新上
is_hotint热卖
is_discountint促销
is_recommandint推荐
is_commentint站点唯一值
created_atdatetime创建时间
updated_atdatetime站点唯一值
plugin_idint插件商品
virtual_salesint虚拟销量
need_addressint商品下单是否需要填写地址
type2int商品类型2
aliasstring商品简称
status_namestring站点唯一值
has_many_optionsobject(array)商品规格

商品规格

参数名类型描述
idintid
uniacidint站点唯一值
goods_idint商品id
titlestring规格名称
thumbstring规格图片
product_pricestring(decimal)现价
market_pricestring(decimal)市场价
cost_pricestring(decimal)成本价
stockint库存
weightstring(decimal)重量
display_orderint排序
specsint规格值ID组合
skuIdint
goods_snstring商品规格编码
product_snstring商品规格条码
virtualint是否虚拟商品
volumestring(decimal)体积