查询订单可用折扣-ListOrderDiscounts
接口约束
该接口只允许使用客户AK/SK或者Token调用。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见策略授权参考。
- 如果使用身份策略授权,需具备如下身份策略权限。
授权项
描述
访问级别
资源类型(*为必须)
条件键
别名
billing:contract:viewDiscount
授予查看商务折扣的权限
read
-
-
-
URI
GET /v2/orders/customer-orders/order-discounts
参数说明请参见下表。
参数 | 是否必选 | 取值范围 | 描述 |
|---|---|---|---|
order_id | 是 | 最大长度:64 | 订单ID。 |
请求消息
请求参数
无。
请求示例
GET https://bss.myhuaweicloud.com/v2/orders/customer-orders/order-discounts?order_id=CS2011091132EMKL9 HTTP/1.1 Content-Type: application/json X-Auth-Token:MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
响应消息
响应参数
参数 | 参数类型 | 取值范围 | 描述 |
|---|---|---|---|
error_code | String | 最大长度:20 | 状态码。 具体请参见状态码。 |
error_msg | String | 最大长度:2000 | 错误描述信息。 |
discounts | List<DiscountInfoV3> | - | 可用的折扣列表。 具体请参见表2。 说明: 用户无对应权限时,该字段不返回内容,参见权限和授权项。 |
参数 | 参数类型 | 取值范围 | 描述 |
|---|---|---|---|
discount_id | String | 最大长度:64 | 订单的可用折扣ID。 支付订单时,输入该参数的值,即可使用折扣。 |
discount_value | String | - | 折扣率或者满减值,如果折扣模式是一口价,这个值为空。 |
discount_type | Integer | - | 折扣类型,取值为
|
orders | List<OrderV3> | - | 可使用折扣的订单列表。 具体请参见表3。 |
参数 | 参数类型 | 取值范围 | 描述 |
|---|---|---|---|
order_id | String | - | 可使用折扣的订单ID。 |
order_line_items | List<OrderLineItemV3> | 最大长度:100 | 可使用折扣的订单项列表,具体参见表4。 |
参数 | 参数类型 | 取值范围 | 描述 |
|---|---|---|---|
order_line_item_ids | List<String> | 最大长度:1000 | 可使用相同折扣的订单项合并后的订单项ID列表。 相同产品、相同规格(对于线性产品)、相同最终价格(例如,严选产品改价)的订单项将进行合并。 |
discount_mode | Integer | - | 订单可用折扣的模式 。
|
discount_amount | Bigdecimal | - | 订单可用的折扣金额(即减免金额)。 |
discount_ratio | Bigdecimal | - | 订单可用的折扣比例。 |
响应示例
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time
{
"discounts": [
{
"discount_id": "PDP2011260815047721TYT48G0BA02EI",
"discount_value": "0.9",
"discount_type": 0,
"orders": [
{
"order_id": "CS2011091132EMKL9",
"order_line_items": [
{
"order_line_item_ids": [
"CS2011091132EMKL9-000002"
],
"discount_mode": 0,
"discount_amount": null,
"discount_ratio": 0.9
},
{
"order_line_item_ids": [
"CS2011091132EMKL9-000001"
],
"discount_mode": 0,
"discount_amount": null,
"discount_ratio": 0.9
}
]
}
]
}
]
} 

