Updated on 2024-08-20 GMT+08:00

Querying an Order

Function

KooGallery sellers can use this API to query all order information.

URI

GET:

https://mkt-intl.myhuaweicloud.com/api/mkp-openapi-public/global/v1/order/query

Table 1 describes the parameters.

Only the HTTPS protocol is supported.

The following figure shows the process of querying an order.

The following table lists the order data used for debugging.

Order No.

Order Line ID

Order Type

MOCKPERIODYEARNEW

MOCKPERIODYEARNEW-000001

Subscription - Yearly/Monthly

MOCKONETIMENEW

MOCKONETIMENEW-000001

Subscription - One-time

MOCKONDEMAND

MOCKONDEMAND-000001

Subscription - Pay-per-use specification

MOCKONDEMANDPKG

MOCKONDEMANDPKG-000001

Subscription - Pay-per-use package

MOCKPERIODDAYTRIAL

MOCKPERIODDAYTRIAL-000001

Trial use

MOCKMONTYTRIALTOFORMAL

MOCKMONTYTRIALTOFORMAL-000001

Change from trial use to commercial use

MOCKMONTYUNSUBSCRIBE

MOCKMONTYUNSUBSCRIBE-000001

Unsubscription

MOCKMONTYRENEW

MOCKMONTYRENEW-000001

Renewal

MOCKMONTYCHANGE

MOCKMONTYCHANGE-000001

Change and upgrade

Request Message

Request parameters

Request method: GET

Parameter

Mandatory

Type

Maximum Length

Description

orderId

Yes

String

64

KooGallery order ID.

orderLineId

No

String

64

KooGallery order line ID.

Notes

  • Strong verification must be performed on the HTTPS certificate of mkt-intl.myhuaweicloud.com to ensure that the real KooGallery service instead of a forged KooGallery service is called.

Example request

GET /api/mkp-openapi-public/global/v1/order/query?orderId=CS2207261447AUY4H&orderLineId=CS2207261447AUY4H-000001
Host: Host Server   
Content-Type: application/json charset=UTF-8  
X-Sdk-Date: request time    
Authorization: authorization   
Table 1 Response parameters

Parameter

Mandatory

Type

Maximum Length

Description

resultCode

Yes

String

16

Result code.

For details, see Table 3.

resultMsg

Yes

String

1,024

Result message.

For details, see Table 3.

orderInfo

No

OrderInfo

/

Additional information.

NOTE:

For details about the OrderInfo data structure, see the following table.

The following table describes the OrderInfo data structure.

Parameter

Mandatory

Type

Maximum Length

Description

orderId

Yes

String

64

KooGallery order ID.

orderType

Yes

String

32

Order type. The options are as follows:

  • NEW: new subscription.
  • TRIAL: trial use.
  • TRIAL_TO_FORMAL: commercial use after trial use.
  • UNSUBSCRIBE: unsubscription.
  • RENEW: renewal.
  • CHANGE: change.

createTime

Yes

DateTime

20

Time when an order is created.

Format: yyyyMMddHHmmss

NOTE:

It is not the time when the order takes effect but the time when the order is placed.

orderLine

  

List<OrderLine>

  

Order line information.

buyerInfo

No

BuyerInfo

/

Customer information.

The following table describes the OrderLine data structure.

Parameter

Mandatory

Type

Maximum Length

Description

orderLineId

Yes

String

64

KooGallery order line ID.

chargingMode

Yes

String

25

Billing mode.

ON_DEMAND: pay-per-use.

ONE_TIME: one-time payment.

PERIOD: yearly/monthly/daily.

ON_DEMAND_PKG: pay-per-use package.

expireTime

No

DateTime

20

Expiration time.

Format: yyyyMMddHHmmss

NOTE:
  • This parameter is required for a yearly/monthly/daily product.
  • This parameter is not required for a product billed by uses.

This parameter is determined based on the order creation time and the subscription duration and may differ from the actual expiration time of the order. It is for reference only.

periodType

No

String

2

Period type.

NOTE:

This parameter is only required for yearly/monthly/daily subscriptions (chargingMode is set to PERIOD).

Yearly subscription: year

Monthly subscription: month

extendParams

No

List<ExtendParam>

/

Extension parameters.

An extension parameter is an array in the key/value format.

Example: [{"name":"emailDomainName","value":"test.xxxx.com"},{"name":"ip","value":"192.168.1.1"}]

In the preceding information, emailDomainName and ip are set during product release.

periodNumber

No

integer

5

Number of periods.

NOTE:

This parameter is only required for yearly/monthly/daily subscriptions (chargingMode is set to PERIOD).

Enter a positive integer, for example, 1, 2, and 3.

currency

No

String

64

Order amount. In scenarios such as subscription, renewal, and specification change, the amount is positive. In scenarios such as unsubscription and renewal cancellation, the amount is empty.

currencyAfterDiscount

No

String

25

Order transaction amount, excluding cash coupons and discounts. In scenarios such as subscription, renewal, and specification change, the amount is positive. In scenarios such as unsubscription and renewal cancellation, the amount is negative.

productInfo

Yes

List<ProductInfo>

  

Product information associated with the order line.

The following table describes the ProductInfo data structure.

Parameter

Mandatory

Type

Maximum Length

Description

productId

Yes

String

64

Product ID. The value of productId varies between products of different billing modes under the same skuCode.

For example, when you release a product and add a new specification, an skuCode value is generated. After yearly and monthly billing prices are configured, two productId values are generated.

NOTE:

Log in to the Seller Console. Then, choose Product Management > My Products. In the row of your product, click Details in the Operation column. On the product details page, you can view the value of this parameter.

skuCode

Yes

String

64

Specification ID. When renewing the subscription of a yearly/monthly product, a customer can change the billing mode (for example, from monthly to yearly). In this case, productId corresponding to instanceId of the instance enabled by the customer changes, but the value of skuCode does not change.

NOTE:

Log in to the Seller Console. Then, choose Product Management > My Products. In the row of your product, click Details in the Operation column. On the product details page, you can view the value of this parameter.

linearValue

No

Integer

  

Linear value that the customer selected when placing the order for a product with the quantity attribute.

productName

Yes

String

64

Product name.

The following table describes the ExtendParam data structure.

Table 2 Response parameters

Parameter

Mandatory

Type

Maximum Length

Description

name

Yes

String

64

Parameter name.

value

Yes

String

64

Parameter value.

The following table describes the BuyerInfo data structure.

Parameter

Mandatory

Type

Maximum Length

Description

customerId

Yes

String

64

Customer ID.

customerName

Yes

String

64

Customer account name.

mobilePhone

No

String

64

Mobile number of the customer.

NOTE:

You can specify whether customers must authorize you to obtain this information when you release a product.

email

No

String

64

Email address of the customer.

NOTE:

You can specify whether customers must authorize you to obtain this information when you release a product.

userId

No

String

64

IAM user ID.

NOTE:

You can specify whether customers must authorize you to obtain this information when you release a product.

userName

No

String

64

IAM user name.

NOTE:

You can specify whether customers must authorize you to obtain this information when you release a product.

Error Codes

Table 3 Error codes

HTTP Status Code

resultCode

resultMsg

Description

200

MKT.0000

Success.

Request successful.

500

MKT.0999

System internal error.

Other internal errors.

500

MKT.0100

Failure of input parameter

Input parameter verification failed.

Invalid value.

400

MKT.0101

Invalid parameter

Invalid parameter.

The parameter is not defined by the API, there are more parameters than required, or a mandatory parameter is missing.

400

MKT.0199

Request parameter error

Incorrect request parameter.

Other parameter errors.

401

MKT.0150

Illegal operation

You are trying to perform an unauthorized operation. For example, the product corresponding to instanceId is not released by the seller corresponding to the AK/SK.

401

MKT.0151

No authority

Insufficient permissions to access the interface.

The token does not belong to a seller.

401

MKT.0154

Illegal token

Authentication failed.

Invalid token.

406

MKT. 0250

Access frequency overlimit

Too many access requests.

500

MKT.9001

Instance ID not found.

The instance ID does not exist. (This result code may be returned when the renewal, expiration, or resource release interface is called.)

500

MKT.9002

Invalid usage entities.

Invalid usage entities.

500

MKT.9003

Usage records extend size limit.

Too many records. Max. records: 100.

500

MKT.9004

Record beginTime extends Limit.

The start time exceeds the validity period (last 21 days).

A failure response contains the extra_info parameter only when the value of resultCode is MKT.0100, MKT.0150, MKT.0250, MKT.9001, MKT.9002, MKT.9004, or MKT.9005. In addition to the parameter description, resultMsg in the failure response also contains the failure details. You can locate and rectify the fault based on the failure details and extra_info content.

Successful response example

HTTP/1.1 200 OK 
Content-Type: application/json;charset=UTF-8 
Content-Length: length 
Date: response time  
 
{
  "resultCode": "MKT.0000",
  "resultMsg": "Success",
  "orderInfo": {
    "orderId": "CS2207261447AUY4H",
    "orderType": "NEW",
    "createTime": "20220726064736",
    "orderLine": [
      {
        "orderLineId": "CS2207261447AUY4H-000001",
        "chargingMode": "PERIOD",
        "periodType": "year",
        "periodNumber": 1,
        "expireTime": "20230726155959",
        "productInfo": [
          {
            "productId": "OFFI758576253042421760",
            "skuCode": "da9b4d34-ee8a-4355-a823-13e034e49986",
            "linearValue": 10,
            "productName": "Test SaaS, Test Specification, Basic Edition, Yearly/Monthly"
          }
        ],
        "extendParams": []
      }
    ],
    "buyerInfo": {
      "mobilePhone": "18699999999",
      "email": 123@test.com,
      "customerId": "688055390f3049f283fe9f1aa90f7ds3",
      "customerName": "hw1235sd3123"
 
    }
  }
}

Failed response example

HTTP/1.1 401 UnauthorizedContent-Type: application/json;charset=UTF-8Content-Length: lengthDate: response time { 
    "resultCode": "CBC.0150", 
    "resultMsg": "Illegal operation. param[isvId] and param[instanceId] do not match."  }