# 优惠券SP多租户开放文档
# 开平注册商户
如果已经注册过了无需二次入驻,需要与开平侧研发 @andynwang(王念) 确认
# 创建服务入驻商户
正式环境:
- https://open.go.qq.com/v2/#/login?redirect=%2Fhome%2Findex (opens new window)
- 正式环境注册商户后,将自动同步创建在测试环境,apikey 和 secretkey 在平台中可以看到(如下左图)
- 联调使用测试环境的apikey 和 secretkey
spId,需要在开放平台创建一个应用,业务类型注意需要选择"开放平台"(如下右图)
手机号加密密钥,在邮件中发送(咨询优惠券研发 @chaoscchen(陈浩) )
# 调用权限开通
咨询开平侧研发 @andynwang(王念)
# SP优惠券(多租户)
# 开平域名
正式环境:https://sp.wecar.map.qq.com/openplatform/api/v1/coupon (opens new window)
测试环境:https://test.tai.qq.com/openplatform/api/v1/coupon (opens new window)
# 领券
- 接口说明 本接口用于腾讯出行服务调用接入方领券接口发券。
- 请求地址 接入方提供
- 请求方式 POST
- 请求参数 通用参数 + 业务参数
| 参数名称 | 类型 | 最大长度 | 必选 | 说明 |
|---|---|---|---|---|
| app_channel_id | int | 10 | 是 | 多租户渠道ID 0:出行服务 11:手图 |
| user_code | string | 32 | 是 | 用户标识 |
| mobile_phone | string | 11 | 是 | 手机号码(加密后的手机号,密钥 咨询腾讯侧研发) |
| stock_id | string | 30 | 是 | 批次 ID |
| request_id | string | 32 | 是 | 请求 ID(业务唯一,根据 request_id 做幂等处理) |
| extra | string | 128 | 否 | 扩展信息 |
- 返回数据
| 参数名称 | 类型 | 最大长度 | 必选 | 说明 |
|---|---|---|---|---|
| code | int | 11 | 是 | 服务响应状态码,参见错误码表 |
| message | string | 64 | 是 | 服务响应状态说明,参见错误码表 |
| data | object | - | 否 | - |
| app_id | string | 32 | 是 | 小程序 appId |
| stock_id | string | 30 | 是 | 批次 ID |
| coupon_id | string | 20 | 是 | 优惠券 ID |
| coupon_type | int | 4 | 是 | 优惠券类型 1:满减券 2:减至券 3:折扣券 |
| fixed_normal_coupon | object | - | 否 | 满减券信息 |
| fixed_normal_coupon.coupon_amount | long | 20 | 是 | 优惠券面额(单位:分) |
| fixed_normal_coupon.transaction_minimum | long | 20 | 是 | 优惠券使用门槛(单位:分) |
| discount_coupon | object | - | 否 | 折扣券信息 |
| discount_coupon.discount_amount_max | long | 20 | 是 | 最高折扣金额(单位:分) |
| discount_coupon.discount_percent | int | 11 | 是 | 折扣百分比,例如 88-八八折 |
| discount_coupon.transaction_minimum | long | 20 | 是 | 使用券金额门槛(单位:分) |
| available_begin_time | string | 32 | 是 | 可用开始时间,格式: yyyy-MM-ddTHH:mm:ss: SSS+TIMEZONE |
| available_end_time | string | 32 | 是 | 可用结束时间,格式: yyyy-MM-ddTHH:mm:ss. SSS+TIMEZONE |
| receive_time | string | 32 | 是 | 领券时间,格式: yyyy-MM-ddTHH:mm:ss. SSS+TIMEZONE |
| coupon_status | int | - | 是 | 优惠券状态 1:可用 2:已使用 3:已过期 |
- 请求数据示例
{
"api_key": "PSUBZLHOKUO6HV52A5CAUSSE5KSB6Y",
"seq_id": "38d42bd9-9f5a-415e-89d9-ea4ff9cffdf2",
"timestamp": "1572342076",
"nonce": "157234207",
"sign": "8A983278E5366EB93FEB0D4143E1C522",
"app_channel_id":1,
"user_code": "udxbieurieuirouerieuxd",
"mobile_phone": "13911112222",
"stock_id": "test001",
"request_id": "123456789",
"extra": "extra info"
}
- 返回数据示例
{
"code": 0,
"message": "success",
"data": {
"app_id": "wx1111111111",
"stock_id": "1237848734",
"coupon_id": "jhfhdejkfhe89r8erejrkejrke",
"coupon_type": 1,
"fixed_normal_coupon": {
"coupon_amount": 1000,
"transaction_minimum": 1000
},
"discount_coupon": {
"discount_amount_max": 1000,
"discount_percent": 88,
"transaction_minimum": 1000
},
"available_begin_time": "2025-07-05T13:29:35.120+08:00",
"available_end_time": "2025-08-05T13:29:35.120+08:00",
"receive_time": "2025-07-09T13:29:35.120+08:00",
"coupon_status": 1
}
}
# 同步批次信息
- 接口说明 本接口用于接入方回调腾讯出行服务同步优惠券批次信息。
- 请求地址 域名 + /sp/stock/rsync
- 请求方式 POST
- 请求参数 通用参数 + 业务参数
| 参数名称 | 类型 | 最大长度 | 必选 | 说明 |
|---|---|---|---|---|
| app_channel_id | int | 10 | 是 | 多租户渠道ID 0:出行服务 11:手图 |
| app_id | string | 32 | 是 | 小程序 appId |
| buss_classify | int | 10 | 否 | 业务类型 |
| stock_id | string | 30 | 是 | 批次 ID |
| stock_name | string | 20 | 是 | 批次名称 |
| instructions | string | 1024 | 是 | 使用说明 |
| coupon_name | string | 20 | 是 | 券名称 |
| coupon_desc | string | 50 | 是 | 券描述 |
| coupon_type | int | 4 | 是 | 优惠券类型 1:满减券 2:减至券 3:折扣券 |
| fixed_normal_coupon | object | - | 否 | 满减券信息 |
| fixed_normal_coupon.coupon_amount | long | 20 | 是 | 优惠券面额(单位:分) |
| fixed_normal_coupon.transaction_minimum | long | 20 | 是 | 优惠券使用门槛(单位:分) |
| discount_coupon | object | - | 否 | 折扣券信息 |
| discount_coupon.discount_amount_max | long | 20 | 是 | 最高折扣金额(单位:分) |
| discount_coupon.discount_percent | int | 11 | 是 | 折扣百分比,例如 88-八八折 |
| discount_coupon.transaction_minimum | long | 20 | - | 使用券金额门槛(单位:分) |
| max_coupons | int | 11 | 是 | 总发券数量 |
| max_coupons_per_user | int | 11 | 是 | 单个用户可领个数 |
| available_begin_time | string | 32 | 是 | 可用开始时间,格式:yyyy-MM-ddTHH:mm:ss. SSS+TIMEZONE |
| available_end_time | string | 32 | 是 | 可用结束时间,格式: yyyy-MM-ddTHH:mm:ss. SSS+TIMEZONE |
| create_time | string | 32 | 是 | 创建时间,格式: yyyy-MM-ddTHH:mm:ss. SSS+TIMEZONE |
| stock_status | int | 4 | 是 | 批次状态 1:未激活 2:审核中 3:运行中 4:已停止 5:暂停发放 |
| province_name | string | 2000 | 否 | 优惠券适用省份名称,多个名称之间使用逗号隔开 |
| province_code | string | 2000 | 否 | 优惠券适用省份code,多个名称之间使用逗号隔开 |
| city_name | string | 5000 | 否 | 优惠券适用城市名称,多个名称之间使用逗号隔开 |
| city_code | string | 5000 | 否 | 优惠券适用城市code,多个code之间使用逗号隔开 |
- 返回数据
| 参数名称 | 类型 | 最大长度 | 必选 | 说明 |
|---|---|---|---|---|
| code | int | 11 | 是 | 服务响应状态,参见错误码表 |
| message | string | 64 | 是 | 服务响应状态说明,参见错误码表 |
| data | object | - | 否 | - |
- 请求数据示例
{
"api_key": "PSUBZLHOKUO6HV52A5CAUSSE5KSB6Y",
"seq_id": "38d42bd9-9f5a-415e-89d9-ea4ff9cffdf2",
"timestamp": "1572342076",
"nonce": "157234207",
"sign": "8A983278E5366EB93FEB0D4143E1C522",
"app_channel_id":1,
"app_id": "wx11111111",
"stock_id": "test001",
"stock_name": "代驾代金券",
"instructions": "详细的券使用说明",
"coupon_name ": "代驾代金券",
"coupon_desc ": "满10元可用,仅限深圳地区使用",
"coupon_type ": 1,
"fixed_normal_coupon": {
"coupon_amount": 1000,
"transaction_minimum": 10000
},
"discount_coupon": {
"discount_amount_max": 1000,
"discount_percent": 88,
"transaction_minimum": 10000
},
"max_coupons ": 20000,
"max_coupons_per_user ": 1,
"available_begin_time": "2020-07-05T13:29:35.120+08:00",
"available_end_time": "2020-07-30T23:59:59.120+08:00",
"create_time": "2020-07-30T23:59:59.120+08:00",
"stock_status": 3,
"province_name": "广东省",
"province_code": "516324",
"city_name": "深圳市",
"city_code": "44030000"
}
- 返回数据示例
{
"code": 0,
"message": "successful"
}
# 同步优惠券状态
- **接口说明:**本接口用于同步优惠券状态信息
- 请求地址 域名 + /sp/coupon/status/rsync
- 请求方式 POST
- 请求参数 通用参数 + 业务参数
| 参数名称 | 类型 | 最大长度 | 必选 | 说明 |
|---|---|---|---|---|
| app_channel_id | int | 10 | 是 | 多租户渠道ID 0:出行服务 11:手图 |
| user_code | string | 32 | 是 | 用户标识 |
| buss_code | int | 10 | 是 | 业务类型(固定写 301即可) |
| mobile_phone | string | 11 | 否 | 手机号码 |
| stock_id | string | 30 | 是 | 批次 ID |
| coupon_id | string | 20 | 是 | 优惠券 ID |
| coupon_status | int | 11 | 是 | 优惠券状态 1: 可用 2: 已使用 3: 已过期 |
| usage_time | string | 32 | 否 | 使用时间,格式: yyyy-MM-ddTHH:mm:ss. SSS+TIMEZONE |
| event_time | string | 32 | 否 | 事件时间,格式: yyyy-MM-ddTHH:mm:ss. SSS+TIMEZONE |
| version | string | 10 | 否 | 版本:当前版本:1.0.1 |
| extra | string | 128 | 否 | 扩展信息 |
- 返回数据
| 参数名称 | 类型 | 最大长度 | 必选 | 说明 |
|---|---|---|---|---|
| code | int | 11 | 是 | 服务响应状态,参见错误码表 |
| message | string | 64 | 是 | 服务响应状态说明,参见错误码表 |
| data | object | - | 否 | - |
- 请求数据示例
{
"api_key": "PSUBZLHOKUO6HV52A5CAUSSE5KSB6Y",
"seq_id": "38d42bd9-9f5a-415e-89d9-ea4ff9cffdf2",
"timestamp": "1572342076",
"nonce": "157234207",
"sign": "8A983278E5366EB93FEB0D4143E1C522",
"app_channel_id":1,
"user_code": "udxbxd",
"buss_code": 301,
"mobile_phone": "12911112222",
"stock_id": "test001",
"coupon_id": "1234567",
"coupon_status": 2,
"usage_time ": "2020-07-20T13:29:35.120+08:00",
"event_time ": "2020-07-20T13:29:35.120+08:00",
"extra": "扩展信息"
}
- 返回数据示例
{
"code": 0,
"message": "successful"
}
← 拼车助手 腾讯出行服务MCP接入指南 →