编辑商品事件
消息与事件接收URL
发送 POST
请求开发指南
-准备
-回调事件接入指南
进行接入请求参数名 | 类型 | 说明 |
---|---|---|
data | Object | 消息体 |
data.id | String | 事件id |
data.event | String | 事件主类型(固定:MALL_GOODS) |
data.action | String | 事件子类型(固定:MALL_GOODS_UPDATE) |
data.body | Object | 数据内容 |
data.body.name | String | 商品名称 |
data.body.snowflakeId | String | 商品ID |
data.body.type | Int | 商品类型 1=普通商品;2=虚拟商品;3=优惠券商品; |
data.body.status | Int | 上架状态 1=上架;2=下架; |
data.body.totalInventory | Int | 商品总库存数量 |
data.body.categoryId | String | 分类ID 层级以“/”分割 一级分类ID/二级分类ID/三级分类ID |
data.body.categoryName | String | 商品分类 层级以“/”进 行分割 “一级分类/二级分类/三级分类” |
data.body.code | String | 商品编码 |
data.body.unit | String | 单位 |
data.body.marketPrice | Int | 市场价格 除以10000后,单位为元 |
data.body.price | Int | 商品价格(sku中最低价),除以10000后,单位为元 |
data.body.customField | String | |
data.body.resource | Object | 商品媒体资源 |
data.body.resource.detailImages | Object[] | 详情图片数组 |
data.body.resource.detailImages.name | String | 图片名 |
data.body.resource.detailImages.url | String | 资源url |
data.body.resource.images | Object[] | 头图数组 |
data.body.resource.images.name | String | 图片名 |
data.body.resource.images.url | String | 资源url |
data.body.resource.detailVideoCovers | String[] | 详情视频封面url数组 |
data.body.resource.detailVideos | Object[] | 视频详情数组 |
data.body.resource.detailVideos.name | String | 资源名 |
data.body.resource.detailVideos.second | Int | 视频长度 |
data.body.resource.detailVideos.size | Int | 视频大小 |
data.body.resource.detailVideos.url | String | 资源url |
data.body.skus | Object[] | sku信息 |
data.body.skus.skuId | String | skuId |
data.body.skus.code | String | 规格编码 |
data.body.skus.inventory | Int | 库存数 |
data.body.skus.name | String | 规格名称 |
data.body.skus.price | Int | 价格 |
data.body.skus.cost | Int | 成本价 |
data.body.skus.attributeItems | String[] | 规格子选项id数组 |
data.body.attributes | Object[] | |
data.body.attributes.attributeId | String | 商品规格ID |
data.body.attributes.name | String | 商品属性名字 |
data.body.attributes.option | Object[] | 可选属性数组 |
data.body.attributes.option.id | String | 规格ID |
data.body.attributes.option.imageUrl | String | 规格对应的图片 |
data.body.attributes.option.value | String | 规格对应的值 |
data.body.scene | String | 事件触发场景 system=系统触发; |
json
- Request-Example:
//信息明文推送
{
"id": "0f9a8f2e-4eaf-4aa3-b05f-dfbb11c8ebe3",
"event": "MALL_GOODS",
"action": "MALL_GOODS_UPDATE",
"body": {
"name": "复制商品测试0524001修改",
"snowflakeId": "1661192984314200064",
"type": 1,
"status": 1,
"totalInventory": 33,
"categoryId": "ecd83746-c79f-11ec-8566-bac9cdc05de1",
"categoryName": "酒水",
"code": "",
"unit": "件",
"marketPrice": 0,
"price": 1990000,
"customField": "",
"resource": {
"detailImages": [{
"name": "1369704951311.jpg",
"url": "https://cdn-order-test.dustess.com/W00000000109/order/o/1/8/8/o1886qi1o0f1684738745047.jpg"
}],
"images": [{
"name": "微信图片_20211023181809.jpg",
"url": "https://cdn-order-test.dustess.com/W00000000109/order/h/n/o/g/hnog20p12ve1684738739054.jpg"
}],
"detailVideoCovers": [],
"detailVideos": []
},
"skus": [{
"skuId": "02b8917a-376b-4489-adda-3a7ea6848d94",
"code": "",
"inventory": 11,
"name": "小",
"price": 1990000,
"cost": 100000,
"attributeItems": ["793a10a8-a28b-11eb-92df-f45c89a8d403"]
}, {
"skuId": "d6637473-9964-4141-98b7-54ba34737796",
"code": "",
"inventory": 11,
"name": "中",
"price": 1990000,
"cost": 100000,
"attributeItems": ["793a10bc-a28b-11eb-92df-f45c89a8d403"]
}, {
"skuId": "e3061d82-9ec7-4981-aea6-c9c9f20970d0",
"code": "",
"inventory": 11,
"name": "大",
"price": 1990000,
"cost": 100000,
"attributeItems": ["793a10d0-a28b-11eb-92df-f45c89a8d403"]
}],
"attributes": [{
"attributeId": "29e283eb-573b-4cc7-af10-0376a99c7237",
"name": "容量",
"option": [{
"id": "793a10a8-a28b-11eb-92df-f45c89a8d403",
"imageUrl": "",
"value": "小"
}, {
"id": "793a10bc-a28b-11eb-92df-f45c89a8d403",
"imageUrl": "",
"value": "中"
}, {
"id": "793a10d0-a28b-11eb-92df-f45c89a8d403",
"imageUrl": "",
"value": "大"
}]
}],
"scene": "system"
}
}
//信息加密推送
{
"id": "350670664413253632",
"event": "MALL_GOODS",
"action": "MALL_GOODS_UPDATE",
"body": {
"encrypt": "XOKphmyMEcuW94gYtL/5Nj4ueFcfjaEFecC507QGzXbnDmavLp7I+s7K5BI4Qjt+Ayy/mNbw9bUE2x0HkSWm9h57VKJc9VLBghTjALWJcJduBDC7L6doORsZdaNlfVJU6DJ0VLyd1NojW9PfrzS01eQ7GW/dgaO3tkXQP2AOrGTn3Ca8haZQiwEJDYN/NUjW1/9T+gIcBu8LbmZGyokwrOD+ZGy7uky37yq8w8SGpis1WR2pIlZUOo+QdmWnMY1kJ9bHelH9h3ERemmNRIh/oMZp7QvFaNl/iCgUVAkh14tOV0nniE9Ld29GxyIEFz0nxD5+s4AG4cvq+xl+FXhu0A==",
"msgSignature": "d64cc4a02b22b725a6b50a9843ebf9c0fd7ca70f",
"timeStamp": "1661233174",
"nonce": "9ZvYhI4aFmR7wUNl"
}
}
修改于 2024-09-20 10:58:40