使用场景:
企业将自有系统中的优惠券导入兔展平台
接口地址 /api/integrate/coupon/batchAdd
请求方式 POST
consumes ["application/json"]
produces ["application/json"]
接口描述 优惠券导入接口
应用权限 优惠券->券库券码同步
#请求参数
###请求头参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
---|---|---|---|---|---|
X-Token | 自建应用访问token | header | true | string |
###公共参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
---|---|---|---|---|---|
publicParams | 导入配置 | body | true | object | 优惠券导入配置 |
data | 导入数据,每次最大500条 | body | true | array | 优惠券 |
###优惠券导入配置
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
---|---|---|---|---|---|
optType | 导入方式(add: 新增) | body | true | String | |
batchId | 批次ID | body | true | String | |
batchStatus | 批次同步状态(0:同步开始, 1:同步中, 2:同步完成, 3:同步失败) | body | true | int | |
batchMsg | 批次同步信息,同步失败时候,失败信息 | body | false | String | |
batchTotal | 批次总数 | body | false | long |
###优惠券
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
---|---|---|---|---|---|
thirdCouponTplId | 第三方卡券模板ID | body | false | String | |
couponCode | 券CODE | body | true | String | |
validateType | 卡券码领取时效类型(1:时间区间, 2:按领取后有效天数, 3:永久有效),不传以券模板数据为准 | body | false | Integer | |
startTime | 卡券有效开始时间,validateType=1必填 | body | false | Date | |
endTime | 卡券有效结束时间,validateType=1必填 | body | false | Date | |
awardAfterDay | 领取后有效天数,validateType=2必填 | body | false | Integer |
###请求示例
{
"publicParams":{
"optType":"add"
},
"data":[{
"thirdCouponTplId":"TTPL00000001",
"couponCode":"C00000001",
"validateType":"2",
"startTime":"",
"endTime":"",
"awardAfterDay":"20"
}]
}
#响应参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
---|---|---|---|---|---|
code | 状态码 | body | true | string | |
errorCode | 异常码 | body | true | string | |
msg | 描述 | body | true | string | |
data | 响应数据 | body | true | object | 优惠券导入结果 |
###优惠券导入结果 | 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | | ------ | ------ | ------ | ------ | ------ | ------ | | status | 任务状态(-1: 失败, 0: 进行中, 1: 成功, 2: 部分导入成功) | body | true | int | | | errorData | 导入失败数据 | body | true | array | 优惠券 |
###响应状态
状态码 | 说明 | schema |
---|---|---|
200 | OK | |
201 | Created | |
401 | Unauthorized | |
403 | Forbidden | |
404 | Not Found |
###响应示例
{
"code": "200",
"errorCode": "SUCCESS",
"msg": "ok",
"data": {
"status": 1,
"errorData": null,
"errorMsg": null
}
}