查询已发放的优惠券
Web UI
一、合作伙伴可以登录合作伙伴中心查询发给客户的代金券。
- 在伙伴中心左侧的导航栏中选择“客户业务 > 代金券管理”。
- 选择“已发放代金券”页签,即可查询已发放的代金券。
二、合作伙伴可以登录合作伙伴中心查询发给客户的现金券。
- 在伙伴中心左侧的导航栏中选择“客户业务 > 现金券管理”。
- 选择“已发放现金券”页签,即可查询已发放的现金券。
REST API
伙伴在伙伴销售平台查询已发放的优惠券列表。

该接口只能给合作伙伴使用,调用的时候必须传递合作伙伴的AK/SK或者Token。
- URI
GET /v1.0/{partner_id}/partner/promotion-mgr/partner-coupons
参数说明请参见下表。
表1 路径参数 参数
是否必选
取值范围
描述
partner_id
是
最大长度:64
合作伙伴ID(华为分配)。
获取方法请参见如何获取合作伙伴ID(partner_id)。
表2 查询参数 参数
是否必选
参数类型
取值范围
描述
coupon_id
否
String
最大长度:64
优惠券ID。
customer_id
否
String
最大长度:64
客户账号ID。获取方法请参见如何获取客户的customer_id/domain_id。
order_id
否
String
最大长度:64
订单ID。
coupon_type
否
Integer
-
优惠券类型:
- 1:代金券
- 4:现金券
status
否
Integer
-
客户优惠券实例状态:
- 1:未激活
- 2:待使用
- 3:已使用
- 4:已过期
active_start_time
否
String
最大长度:64
激活时间(开始)。
输入这个条件,会查询出激活时间大于这个时间的记录。
active_end_time
否
String
最大长度:64
激活时间(结束)。
输入这个条件,会查询出激活时间小于这个时间的记录。
create_start_time
否
String
最大长度:64
创建时间(开始)。
输入这个条件,会查询出创建时间大于这个时间的记录。
create_end_time
否
String
最大长度:64
创建时间(结束)。
输入这个条件,会查询出创建时间小于这个时间的记录。
valid_start_time
否
String
最大长度:64
生效时间(开始)。
输入这个条件,会查询出生效时间大于这个时间的记录。
valid_end_time
否
String
最大长度:64
生效时间(结束)。
输入这个条件,会查询出生效时间小于这个时间的记录。
expire_start_time
否
String
最大长度:64
失效时间(开始)。
输入这个条件,会查询出失效时间大于这个时间的记录。
expire_end_time
否
String
最大长度:64
失效时间(结束)。
输入这个条件,会查询出失效时间小于这个时间的记录。
page_no
否
Integer
最小值:1
当前页。
默认取值为1。
page_size
否
Integer
最小值:1
最大值:100
每页数量。
默认取值为10。
- 请求消息
无。
请求示例
GET https://bss.myhuaweicloud.com/v1.0/{partner_id}/partner/promotion-mgr/partner-coupons?page_no=1&page_size=10 HTTP/1.1 Content-Type: application/json X-Auth-Token:MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
- 响应消息
参数
参数类型
取值范围
描述
error_code
String
最大长度:20
状态码。
具体请参见4。
error_msg
String
最大长度:1000
错误描述信息。
total_count
Integer
-
总数。
user_coupons
List< IQueryUserPartnerCouponsResult>
-
发放的优惠券记录。
具体请参见表3。
表3 IQueryUserPartnerCouponsResult 参数
参数类型
描述
coupon_id
String
优惠券实例ID。
coupon_code
String
优惠券编码。
status
Integer
优惠券状态:
- 1:未激活
- 2:待使用
- 3:已使用
- 4:已过期
- 5:已回收
customer_id
String
客户ID。
coupon_type
Integer
优惠券类别:
- 1:代金券
- 4:现金券
measure_id
Integer
面额单位。
1:元。
face_value
Double
面值。
valid_time
String
生效时间。
UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',如“2019-05-06T08:05:01Z”。
expire_time
String
失效时间。
UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',如“2019-05-06T08:05:01Z”。
order_id
String
订单ID。
promotion_plan_id
String
促销计划ID。
plan_name
String
促销计划名称。
plan_desc
String
促销计划描述。
media_type
Integer
介质类型。
fetch_method
Integer
获取方式。
use_limits
List<ICouponUseLimitInfo>
优惠券限制。
具体请参见表4。
active_time
String
优惠券激活时间。
reserve_time
String
优惠券使用时间。
promotion_id
String
促销ID。
create_time
String
优惠券创建时间。
balance
Double
余额。
lock_order_id
String
锁定优惠券的订单ID。
如果为老版本优惠券,该值为空。
coupon_usage
String
优惠券用途。
is_frozen
String
优惠券是否冻结。
- 0:否
- 1:是
可用优惠券接口返回时不包括冻结状态的优惠券。
响应示例
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: length Date: response time { "error_code": "CBC.0000", "error_msg": "success", "total_count": 2, "user_coupons": [ { "status": 2, "balance": 1000, "coupon_id": "CP180116173831EOD7", "coupon_code": null, "customer_id": "31d5e8e56a42484ab3ae7f6acc1f943d", "coupon_type": 1, "measure_id": 1, "face_value": 1000, "valid_time": "2018-01-15T16:00:00Z", "expire_time": "2018-01-17T15:59:59Z", "order_id": null, "promotion_plan_id": null, "plan_mame": null, "plan_desc": null, "media_type": null, "fetch_method": null, "use_limits": [ { "value1": "0", "value2": null, "use_limiti_info_id": null, "limit_key": "simultaneousUseWithEmpowerDiscount", "value_unit": null, "limit_type": "=", "promotion_plan_id": null }, { "value1": "0", "value2": null, "use_limiti_info_id": null, "limit_key": "usageTimes", "value_unit": null, "limit_type": "=", "promotion_plan_id": null }, { "value1": "0", "value2": null, "use_limiti_info_id": null, "limit_key": "cycleType", "value_unit": null, "limit_type": "=", "promotion_plan_id": null }, { "value1": "00301-101004-0--1", "value2": "10人_自动化套餐 包年 华北区1", "use_limiti_info_id": null, "limit_key": "productId", "value_unit": null, "limit_type": "in", "promotion_plan_id": null } ], "active_time": "2018-01-16T09:38:31Z", "reserve_time": null, "promotion_id": null, "create_time": "2018-01-16T09:38:31Z", "lock_order_id": "", "coupon_usage": null, "is_frozen": "0" }, { "status": 2, "balance": 500, "coupon_id": "CP18011317265613IG", "coupon_code": null, "customer_id": "a02224aa0aa8494698e748ec37cf5999", "coupon_type": 1, "measure_id": 1, "face_value": 500, "valid_time": "2018-01-12T16:00:00Z", "expire_time": "2018-06-30T15:59:59Z", "order_id": null, "promotion_plan_id": null, "plan_mame": null, "plan_desc": null, "media_type": null, "fetch_method": null, "use_limits": [ { "value1": "0", "value2": null, "use_limiti_info_id": null, "limit_key": "simultaneousUseWithEmpowerDiscount", "value_unit": null, "limit_type": "=", "promotion_plan_id": null }, { "value1": "0", "value2": null, "use_limiti_info_id": null, "limit_key": "usageTimes", "value_unit": null, "limit_type": "=", "promotion_plan_id": null }, { "value1": "0", "value2": null, "use_limiti_info_id": null, "limit_key": "cycleType", "value_unit": null, "limit_type": "=", "promotion_plan_id": null } ], "active_time": "2018-01-13T09:26:57Z", "reserve_time": null, "promotion_id": null, "create_time": "2018-01-13T09:26:57Z", "lock_order_id": "", "coupon_usage": null, "is_frozen": "0" } ] }
