Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.
Querying Available Coupons for an Order
Function
A customer can invoke this API to view the coupons available for an order on the self-built platform.
For details about how to check available coupons in Billing Center, see Viewing Cash Coupons.
Constraints
This API can be invoked only by the customer AK/SK or token.
URI
GET /v2/orders/customer-orders/order-coupons
The following table describes the parameter.
Parameter |
Mandatory |
Value Range |
Description |
---|---|---|---|
order_id |
Yes |
A maximum of 64 characters |
Order ID. |
Request
Request parameters
None
Example Request
GET https://bss.myhuaweicloud.eu/v2/orders/customer-orders/order-coupons?order_id=CS170926155954NO7 HTTP/1.1 Content-Type: application/json X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
Response
Response parameters
Parameter |
Type |
Value Range |
Description |
---|---|---|---|
error_code |
String |
A maximum of 20 characters |
Error code. For details, see Returned Values. |
error_msg |
String |
A maximum of 2,000 characters |
Error description. |
count |
Integer |
- |
Total queries. |
user_coupons |
List<CouponInfoV2> |
- |
Querying customer's yearly/monthly resources For details, see Table 2. |
coupon_max_use_quantity |
List<CouponMaxUseQuantity> |
- |
Maximum number of coupons that can be used. For details, see Table 4. |
Parameter |
Type |
Value Range |
Description |
---|---|---|---|
coupon_id |
String |
A maximum of 64 characters |
Coupon ID. |
coupon_code |
String |
A maximum of 64 characters |
Coupon code. |
status |
Integer |
- |
Coupon status. The options are as follows:
|
coupon_type |
Integer |
- |
Coupon type.
|
measure_id |
Integer |
- |
Currency. 1: Dollar |
face_value |
Double |
- |
Face value. |
effective_time |
String |
A maximum of 20 characters |
Effective time. UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z. |
expire_time |
String |
A maximum of 20 characters |
Expiration time. UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z. |
plan_name |
String |
A maximum of 512 characters |
Promotion plan name. |
plan_desc |
String |
A maximum of 512 characters |
Promotion plan description. |
use_limits |
List<LimitInfoV2> |
- |
Coupon limits. For details, see Table 3. |
active_time |
String |
A maximum of 20 characters |
Activation time. UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z. |
last_used_time |
String |
A maximum of 20 characters |
Last use time. UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z. |
create_time |
String |
A maximum of 20 characters |
Creation time. UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z. |
coupon_version |
Integer |
- |
Coupon version.
|
balance |
Double |
- |
Balance. |
used_by_order_id |
String |
A maximum of 64 characters |
ID of the order for which a coupon is used. A coupon used for an order cannot be used for other orders. |
coupon_usage |
String |
A maximum of 512 characters |
Coupon usage. |
coupon_group |
Integer |
- |
Coupon category
|
Parameter |
Type |
Value Range |
Description |
---|---|---|---|
use_limiti_info_id |
String |
A maximum of 128 characters |
Usage limit ID. |
limit_key |
String |
A maximum of 1,024 characters |
Discount limit. For details about the value, see Table 5. |
value1 |
String |
A maximum of 2,048 characters |
Value 1. |
value2 |
String |
A maximum of 2048 characters |
Value 2. |
value_unit |
String |
A maximum of 1,024 characters |
Value unit. |
limit_type |
String |
A maximum of 1,024 characters |
Limit type. |
promotion_plan_id |
String |
A maximum of 128 characters |
Promotion plan ID. |
Parameter |
Type |
Value Range |
Description |
---|---|---|---|
coupon_type |
Integer |
- |
Coupon type.
|
coupon_group |
Integer |
- |
Coupon category
|
use_quantity_value |
Integer |
- |
Number of used coupons. |
Currently, flexi-purchase coupons and discount coupons are not available for the European site.
Key |
Meaning |
Description |
Remarks |
---|---|---|---|
baseValue |
Order amount. |
value1 specifies the lower limit of the order amount, and value2 specifies the upper limit of the order amount. |
Cash coupons, flexi-purchase coupons, and discount coupons are supported. |
serviceType |
Cloud service type. |
Only value1 is valid. To obtain a specific cloud service type, call the API in Querying Cloud Service Types. |
Cash coupons, flexi-purchase coupons, and discount coupons are supported. |
regionCode |
Region code. |
value1 specifies the region code, and value2 specifies the region name. |
Cash coupons, flexi-purchase coupons, and discount coupons are supported. |
productId |
Product ID |
You can configure multiple product IDs. Separate them using commas (,). |
Cash coupons, flexi-purchase coupons, and discount coupons are supported. |
subscribeType |
Order type. |
Only value1 is valid. The value can be:
|
Cash coupons, flexi-purchase coupons, and discount coupons are supported. |
firstOrderInService |
Restriction for the first-time purchase. |
Only value1 is valid. |
Cash coupons, flexi-purchase coupons, and discount coupons are supported. |
cycleNum |
Number of periods. |
Only value1 is valid. |
Cash coupons, flexi-purchase coupons, and discount coupons are supported. |
cycleType |
Trial use period type. |
|
Cash coupons, flexi-purchase coupons, and discount coupons are supported. Discount coupons support only the yearly/monthly mode. |
simultaneousUseWithEmpowerDiscount |
Whether cash coupons can be used together with authorized discounts. |
Whether cash coupons can be used with authorized discounts (including commercial discounts and discounts authorized by partners).
|
Cash coupons, flexi-purchase coupons, and discount coupons are supported. The value for discount coupons can only be 0. |
usageTimes |
Whether coupons can be used for multiple times. |
The value is specified in value1. The value can be:
|
|
isOnlyForStrictSelected |
Whether the coupons can only be used for Featured Products on KooGallery. |
The value is specified in value1. The value can be:
If there is no such restriction, the value is 0. This restriction applies only to flexi-purchase coupons. |
Flex-purchase coupons are supported. |
isRebate |
Whether coupons are counted in to the partner incentive rebates. |
The value is specified in value1. The value can be:
This restriction applies only to flexi-purchase coupons. |
Flex-purchase coupons are supported. |
serviceTypeBlackList |
Service type blacklist. |
Service type blacklist. The service type code is specified in value1. This restriction applies only to flexi-purchase coupons. |
Flex-purchase coupons are supported. |
minConsumeDiscount |
Minimum customer consumption discount. |
The value is specified in value1. The value ranges from 0 to 1 (excluding 0 and 1). |
Cash coupons and flexi-purchase coupons are supported. |
isForAnnualContracts |
Whether coupons can only be used for yearly/monthly (one-year) orders. |
The value can be:
|
Cash coupons and discount coupons are supported. |
simultaneousUseWithPromotionProduct |
Whether cash coupons can be used together with promotional products. |
The value is specified in value1. The value can be:
|
Cash coupons and discount coupons are supported. |
simultaneousUseWithPromotionDiscount |
Whether cash coupons can be used together with promotion discounts. |
The value is specified in value1. The value can be:
|
Cash coupons are supported. |
simultaneousUseWithDiscountCoupon |
Whether cash coupons can be used together with discount coupons. |
The value is specified in value1. The value can be:
|
Cash coupons are supported. |
Example Response
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: length Date: response time { "count": "1", "user_coupons": [ { "coupon_id": "CP1*****4VC8", "coupon_code": "", "status": "2", "coupon_type": "301", "measure_id": "1", "face_value": "100", "effective_time": "2021-04-29T15:59:59Z", "expire_time": "2021-04-30T15:59:59Z", "plan_name": "Cash coupon for HUAWEI CLOUD products", "plan_desc": "", "use_limits": [ { "use_limiti_info_id": "", "limit_key": "simultaneousUseWithDiscountCoupon", "value1": "1", "value2": "", "value_unit": "", "limit_type": "", "promotion_plan_id": "" } ], "active_time": "2020-04-24T12:16:55Z", "last_used_time": "", "create_time": "2020-04-24T12:16:55Z", "coupon_version": 2, "balance": 10.0, "used_by_order_id": "", "coupon_usage": "null", "coupon_group": 1 } ], "coupon_max_use_quantity": [ { "coupon_type": 1, "coupon_group": 0, "use_quantity_value": 3 }, { "coupon_type": 1, "coupon_group": 3, "use_quantity_value": 4 }, { "coupon_type": 1, "coupon_group": 1, "use_quantity_value": 2 } ] }
Returned Values
- 4xx: Indicates errors caused by the client side, for example, a request containing bad syntax or incorrect parameters. You must ensure the request is correct.
- 5xx: Indicates error caused by the Huawei Cloud system side. In this case, contact Huawei Cloud customer service.
HTTP Value |
Error Code |
Description |
---|---|---|
400 |
CBC.0100 |
Parameter error. |
403 |
CBC.0151 |
Access denied. |
500 |
CBC.0999 |
Other errors. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.