采购接口(付费开通,请联系商务)
1、接口使用场景
开发者通过api接口的方式获取兑吧补给站上线的商品相关信息(名称、图片、规格、有效期、库存等)并完成系统下单 适用于开发者无自有商品或自有商品不满足业务需求,需要接入兑吧商品的场景
2、采购商品流程图
3、需对接接口
1)前置商品spu信息查询接口(5分钟缓存)
该接口只支持查询兑吧商品(实物、优惠券、直充、话费四种类型),不支持查询开发者自有商品
接口地址:
https://activity.m.duiba.com.cn/gaw/supply/querySpuPage
接口支持http或https协议访问,响应内容中链接的协议头也会自适应转换。
请求方式:get
请求参数:
参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
appKey | string | Y | 255 | 应用唯一标注 |
timestamp | string | Y | 20 | 1970.1.1开始的毫秒数 |
type | string | N | 255 | 商品分组名称,例如:分组1,(如传值就分组查询。不传或者传 空是查询全部) |
appItemName | string | N | 255 | 商品名称(同响应数据中的itemName) |
pageSize | int | N | 11 | 页码,每页返回的数据(默认20,上限不能超过50 |
pageNo | int | N | 11 | 页数,默认第一页 |
sign | string | Y | 255 | 签名 |
响应参数:
参数参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
success | boolean | Y | 是否成功 | |
code | string | Y | 255 | 参见‘响应码明细表’ |
desc | string | Y | 255 | 参见‘响应码明细表’ |
data | object | Y | 参见‘data明细表’ |
data明细表:
参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
totalNum | long | Y | 20 | 商品总数 |
list | java.util.List | 商品列表 |
list明细表:
appItemId | string | Y | 255 | 商品id |
---|---|---|---|---|
type | string | Y | 255 | 商品类型 实物-object,优惠券-coupon,virtual直充商品,话费-phonebill |
images | string | Y | 255 | 商品主图链接,多个图片用逗号分隔 |
smallImage | string | Y | 255 | 商品缩略图链接 |
itemName | string | Y | 255 | 商品名称 |
specificationList | array | 商品规格属性对照表 | ||
sku | java.util.List | |||
phonebillInfo | object | 话费商品信息 | ||
description | string | Y | 255 | 商品图文详情 |
subType | int | N | 20 | 优惠券子类型券码券-0、链接券-1、可重复使用券码-2 |
gmtModified | long | Y | 20 | 最后更新时间 |
specificationList明细:
attributeId | long | N | 20 | 商品规格id |
---|---|---|---|---|
attributeName | string | N | 255 | 商品规格名 |
valueId | long | N | 20 | 商品规格属性id |
valueText | string | N | 255 | 商品规格属性值 |
sku明细:
customPrice | long | Y | 20 | 兑换需要人民币 |
---|---|---|---|---|
customCredits | long | Y | 20 | 兑换需要积分 |
price | long | Y | 20 | 供货价(单位分) |
facePrice | long | Y | 20 | 划线价,单位是分,请自行转换单位 |
stock | long | Y | 20 | 库存 |
skuInfo | string | N | 255 | sku信息,规格1id:对应属性id,规格2id:对应属性id(参照specificationList) |
skuId | long | Y | 20 | skuId(规格id) |
merchantCoding | string | Y | 20 | 商家编码 |
salePrice | long | Y | 20 | 开发者在开发者后台售价 |
validEndDateList | array | N | 20 | 优惠券有效期(1970-01-01开始的时间戳,毫秒为单位,逗号隔开) |
phonebillInfo明细:
degreeType | string | Y | 20 | 话费类型 单档位-single,多档位-multi |
---|---|---|---|---|
facePrice | long | Y | 20 | 话费面额,单位是分,请自行转换单位 |
credits | long | Y | 20 | 兑换需要积分 |
multiDegreeInfo | list | N | 多档位话费的档位信息 |
multiDegreeInfo明细:
facePrice | long | Y | 20 | 话费档位面额,单位是分,请自行转换单位 |
---|---|---|---|---|
credits | long | Y | 20 | 兑换需要积分 |
响应码:
code | desc |
---|---|
0000000000 | 成功 |
9999999 | 发生系统错误 |
1100001 | appKey不能为空 |
1100002 | appKey错误 |
1100003 | 签名验证失败 |
1100014 | 签名不能为空 |
1100015 | 时间戳不能为空 |
1100016 | 请求已过期 |
响应示例:
{
"code": "0000000000",
"data": {
"totalNum": 5,
"list": [
{
"appItemId": 2229794,
"specificationList": [],
"gmtModified": 1586831061000,
"images": "//yun.duiba.com.cn/images/201906/3fwc7d945e.jpg",
"itemName": "芒果TV会员55折大促",
"smallImage": "//yun.duiba.com.cn/images/201910/p8fhe6dirg.png",
"description": "<div><font color=\"#091929\">芒果TV会员55折大促,月卡、季卡、年卡通通55折!</font></div><div><font color=\"#091929\"><br></font></div><div><font color=\"#091929\">使用流程</font></div><div><font color=\"#091929\">1.点击兑换,领取优惠券码</font></div><div><font color=\"#091929\">2.复制以下兑换链接:<a href=\"https://mall.eeext.com/?origin=MjI3NTQ&item_type=mangguochanp\" title=\"Link: https://mall.eeext.com/?origin=MjI3NTQ&item_type=mangguochanp\">https://mall.eeext.com/?origin=MjI3NTQ&item_type=mangguochanp</a> 到浏览器并打开</font></div><div><font color=\"#091929\">3.选择心仪套餐(月/季/年卡),点击立即充值,输入充值账号及优惠券码(可直充到本人账户或好友账户)</font></div><div><font color=\"#091929\">4.支付完成即可成功开通或续费芒果TV会员</font></div><div><font color=\"#091929\"><br></font></div><div><font color=\"#091929\">使用规则</font></div><div><font color=\"#091929\">1.不可与其他芒果TV优惠活动叠加使用</font></div><div><font color=\"#091929\">2.请确认填写的充值账号准确无误,如因账号填写错误无法享受会员权益,我们将无法为您操作退款或会员转让,敬请谅解</font></div><div><font color=\"#091929\">3.如有疑问请联系客服电话:028-83640027 客服QQ:1026934663 (工作时间:9:00-18:00)</font></div>",
"sku": [
{
"customPrice": 0,
"price": 0,
"merchantCoding": null,
"facePrice": 2000,
"validEndDateList": [
1615391999000,
1618070399000
],
"stock": 4106,
"customCredits": 2,
"skuInfo": null,
"skuId": 0
}
],
"type": "coupon"
},
{
"appItemId": 2224493,
"specificationList": [],
"gmtModified": 1586513121000,
"images": "//yun.duiba.com.cn/images/201912/7ah3sntduo.jpg",
"itemName": "饿了么红包大狂欢",
"smallImage": "//yun.duiba.com.cn/images/201912/lahvgd4taw.png",
"description": "<div><b>饿了就要,饿了么送你大红包,最高可领31元,每日可领,先到先得!</b></div><div><b><br></b></div><div><b>使用流程</b></div><div>1.点击兑换,进入活动页面</div><div>2.点击页面上的“戳我领取”登录饿了么账号后再次点击页面上的“戳我领取”即可获得红包(如无出现,请刷新该页面)</div><div>3.红包领取后可在饿了么APP及手机淘宝、支付宝、微信的饿了么小程序上我的账户中查看</div><div>4.使用饿了么下单时满足优惠券使用条件即可选择使用</div><div><b><br></b></div><div><b>使用规则</b></div><div>1.红包大小随机,最低2元,最高31元</div><div>2.每天均可领取一次,新老用户通用</div><div>3.红包使用规则请在饿了么—我的—红包查看详情</div><div>4.如有问题,请联系饿了么官方客服热线:10105757</div>",
"sku": [
{
"customPrice": 0,
"price": 0,
"merchantCoding": null,
"facePrice": 1000,
"validEndDateList": [
1593532799000,
1593532799000,
1609430399000,
1609430399000
],
"stock": 99340,
"customCredits": 2,
"skuInfo": null,
"skuId": 0
}
],
"type": "coupon"
},
{
"appItemId": 2214334,
"specificationList": [],
"gmtModified": 1582029083000,
"images": "//yun.duiba.com.cn/images/201912/3f9h2i4go7.jpg,//yun.duiba.com.cn/images/201912/uwhgw5l6d2.jpg,//yun.duiba.com.cn/images/201912/lexc0hrk5w.jpg",
"itemName": "时来运转茶具套装",
"smallImage": "//yun.duiba.com.cn/images/201912/w5m9sjafo8.jpg",
"description": "<h3><span style=\"color: rgb(51, 51, 51);\">商品详情</span></h3><ul><li>商品名称:时来运转茶具套装 </li><li>商品材质:陶瓷 </li><li>商品尺寸:16.2*10.5 </li><li>商品颜色:如图色 </li><li>商品说明:玩转茶艺,告别烫手,制作精美,时来运转</li></ul><p><br /></p><h3><strong>特别说明</strong></h3><ul><li>若有任何疑问,可咨询客服电话:400-090-0208</li><li>新疆、西藏、港澳台区域暂不支持发货</li><li>商品非质量问题不退换,敬请谅解</li><li>若因地址不详、联系号码错误、停机等个人原因导致快递多次配送不成功,延期退回后我们将不再进行二次发货</li></ul><p><img src=\"//yun.duiba.com.cn/images/201912/07gfs1m6gv.jpg\" /></p>",
"sku": [
{
"customPrice": 0,
"price": 7375,
"merchantCoding": "1232131",
"facePrice": 9800,
"validEndDateList": null,
"stock": 485,
"customCredits": 7375,
"skuInfo": null,
"skuId": 121795
}
],
"type": "object"
},
{
"appItemId": 185160136888329,
"specificationList": [],
"gmtModified": 1651823229000,
"images": "//yun.duiba.com.cn/images/201708/agr0kr8ohj.png",
"itemName": "5元话费",
"smallImage": "//yun.duiba.com.cn/images/201708/koarzfg87v.png",
"phonebillInfo": {
"credits": 5,
"degreeType": "single",
"facePrice": 500,
"multiDegreeInfo": null
},
"description": "5元手机话费直充,全国通用,快速到帐。<br><br><h4>特别说明:</h4><h4><span class=\"wysiwyg-color-red\" style=\"color: red;\">1.移动话费10元以下(不含10元)因临时下架,暂无法充值,请更换填写电信或联通号码。</span></h4><h4><span class=\"wysiwyg-color-red\" style=\"color: red;\">2.170虚拟号码、199、166、198等号段不支持充值,携号转网手机号不支持充值。如果是上述号段的号码,请您更换别的手机号码充值哦。</span></h4><h4><span class=\"wysiwyg-color-red\" style=\"color: red;\">3.因系统升级,近期话费充值成功率较低,请谨慎充值,带来不便敬请谅解<br></span></h4><h4><span class=\"wysiwyg-color-red\" style=\"color: red;\">4、短时间内为同一号码连续充值,失败率较高。如果您有多充话费的需求,建议2单之后改日再充值。</span></h4><h4><span class=\"wysiwyg-color-red\" style=\"color: red; font-size: 14px; font-weight: 400;\"></span></h4><h4 style=\"margin-bottom: 11px; margin-top: 10px; font-size: 15px; color: rgb(51, 51, 51);\"><span class=\"\" style=\"color: red;\">5、请仔细核对充值账号,一旦提交不可修改</span></h4>",
"subType": null,
"areaLimitDesc": null,
"sku": [],
"type": "phonebill"
},
{
"appItemId": 184715761289079,
"specificationList": [],
"gmtModified": 1640066191000,
"images": null,
"itemName": "手机话费",
"smallImage": "//yun.duiba.com.cn/images/201708/qlds798mvb.png",
"phonebillInfo": {
"credits": null,
"degreeType": "multi",
"facePrice": null,
"multiDegreeInfo": [
{
"credits": 1,
"facePrice": 100
},
{
"credits": 5,
"facePrice": 500
},
{
"credits": 10,
"facePrice": 1000
},
{
"credits": 20,
"facePrice": 2000
},
{
"credits": 50,
"facePrice": 5000
}
]
},
"description": null,
"subType": null,
"areaLimitDesc": null,
"sku": [],
"type": "phonebill"
}
]
},
"success": true,
"desc": "OK",
"timestamp": 1586834354650
}
2)商品采购统一下单接口(url时效5分钟)
接口地址:
https://activity.m.duiba.com.cn/gaw/supply/purchase
接口支持http或https协议访问,响应内容中链接的协议头也会自适应转换。
注意: 若接口返回“发生系统错误”(响应码:9999999)或接口网络异常(如超时等异常情况),请勿直接认为下单失败,需调用 订单状态查询接口 ,确认订单状态。
请求方式:post
请求参数:
参数参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
appKey | string | Y | 255 | 应用唯一标注 |
timestamp | string | Y | 20 | 1970.1.1开始的毫秒数 |
sign | string | Y | 255 | 签名 |
appItemId | long | Y | 20 | 商品id |
skuId | long | Y | 20 | 商品skuId,注:如果商品为话费请填0 |
thirdOrderNum | string | Y | 255 | 第三方订单号 |
account | string | N | 32 | 商品为虚拟商品充值类,则传对应的充值账号 |
wxCouponValue | long | N | 20 | 微信立减金-面额>=100,单位分,不定额立减金时必传 |
wxCouponMinimum | long | N | 32 | 微信立减金-发放门槛>=101,单位分,不定额立减金时必传 |
phoneDegree | long | N | 20 | 商品为多档位话费时,话费的档位面额,单位分 |
phone | string | N | 32 | 实物商品收货人手机号(实物商品必传) |
address | string | N | 255 | 实物商品收货详细地址(实物商品必传) |
province | string | N | 255 | 实物商品收货地址 省份(实物商品必传) |
city | string | N | 255 | 实物商品收货地址 市(实物商品必传) |
district | string | N | 255 | 实物商品收货地址 区、县(实物商品必传) |
street | string | N | 255 | 实物商品收货地址 街道 |
name | string | N | 32 | 实物商品收货人姓名(实物商品必传) |
响应参数:
参数参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
success | boolean | Y | 是否成功 | |
code | string | Y | 255 | 参见‘响应码明细表’ |
desc | string | Y | 255 | 参见‘响应码明细表 |
timestamp | string | Y | 20 | 系统时间戳 |
data | object | Y | 参见‘data明细表’ |
响应码明细表:
code | desc |
---|---|
0000000000 | 成功 |
9999999 | 发生系统错误 |
1100001 | appKey不能为空 |
1100002 | appKey错误 |
1100003 | 签名验证失败 |
1100004 | 第三方订单号重复 |
1100005 | appItemId不能为空 |
1100006 | skuId不能为空 |
1100007 | 实物商品收货信息不能为空 |
1100008 | 第三方订单号不能为空 |
1100009 | 商品不存在 |
1100010 | 商品已下架 |
1100011 | 不支持购买自有商品 |
1100012 | 下单失败稍后再试(库存不足) |
1100013 | 订单不存在 |
1100014 | 签名不能为空 |
1100015 | 时间戳不能为空 |
1100016 | 请求已过期 |
1100017 | appItemIds错误 |
1100018 | 非兑吧采购商品 |
1100019 | 无权访问该商品 |
1100020 | 该地区限制下单 |
1100021 | 该商品该地区不发货 |
1100022 | 虚拟商品充值账号不能为空 |
1100023 | 当前app无接口使用权限 |
1100024 | 今日采购优惠券已达上限 |
1100025 | 当前商品库存不足 |
1100026 | 多档位话费的档位不能为空 |
1100027 | 话费商品充值手机号不能为空 |
1100028 | 手机号码归属地查询异常 |
1100029 | 话费价格非法,无法进行充值兑换 |
1100030 | 话费商品档位配置有误 |
1100031 | 手机号无合适供应商 |
1100032 | 多档位话费的档位有误 |
1100033 | 该商品不支持采购,请联系运营或技术支持 |
1100034 | 立减金面额和门槛不可为空 |
1100035 | 立减金不支持自定义面额和门槛 |
data明细表
参数参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
orderNum | string | Y | 255 | 兑吧订单号 |
响应示例:
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1561392321796,
"data":{
"orderNum":"123032948572"
}
}
3)订单状态查询接口
接口地址:
https://activity.m.duiba.com.cn/gaw/supply/queryOrder
接口支持http或https协议访问,响应内容中链接的协议头也会自适应转换。
注意:该接口需开发者进行轮询获取最新状态(建议轮询时间为:8h/次)
请求方式:get
请求参数
参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
appKey | string | Y | 255 | 应用唯一标注 |
timestamp | string | Y | 20 | 1970.1.1开始的毫秒数 |
sign | string | Y | 255 | 签名 |
thirdOrderNum | string | Y | 255 | 第三方订单号 |
响应参数
参数参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
success | boolean | Y | 是否成功 | |
code | string | Y | 255 | 参见‘响应码明细表’ |
desc | string | Y | 255 | 参见‘响应码明细表’ |
timestamp | string | Y | 20 | 系统时间戳 |
data | object | Y | 255 | 详见‘data明细表’ |
data明细表
参数参数 | 类型 | 是否必填 | 限制长度 | 描述 |
---|---|---|---|---|
thirdOrderNum | string | Y | 255 | 第三方订单号 |
orderNum | string | Y | 255 | 兑吧订单号 |
orderStatus | string | Y | 255 | 订单状态 1:处理中 2:待发货 3:成功(已发货)4:失败 |
failReason | string | N | 255 | 错误原因(系统异常,稍后再试、扣app余额失败,请再试试、兑换券已经用完、商品扣库存失败,实物商品取消发货返回运营填写的取消原因) |
expressNo | string | N | 255 | 快递单号 |
expressCompanyName | string | N | 255 | 快递名称 |
link | string | N | 255 | 优惠券跳转链接 |
code | string | N | 255 | 优惠券券码 |
account | string | N | 255 | 卡密类充值卡号 |
password | string | N | 255 | 卡密类充值密码 |
overdue | long | N | 20 | 券码券有效期,时间戳(1970-01-01开始的时间戳,毫秒为单位) |
备注:
“link”与“code”,“account”与“password”为配套参数
“link”和“code”有返回值的情况下,后者为null;
“account”和“password”有返回值的情况下,前者为null;
响应码明细表
code | desc |
---|---|
0000000000 | 成功 |
9999999 | 发生系统错误 |
1100001 | appKey不能为空 |
1100002 | appKey错误 |
1100003 | 签名验证失败 |
1100014 | 签名不能为空 |
1100015 | 时间戳不能为空 |
1100016 | 请求已过期 |
响应示例
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1561393862580,
"data":{
"thirdOrderNum":"12322222",
"orderNum":"123123123",
"orderStatus":1,
"failReason":"库存不足",
"expressNo":"11111110000",
"expressCompanyName":"圆通快递",
"link":"http:spring.io",
"code":"DWcidneXSAW",
"account":"asdfgh",
"password":"NaDX2i",
"overdue":1561393862580
}
}