Skip to main content

Payment Query API

The Payment Query API provides the ability to query order and refund status, making it easier for developers to proactively check payment results when needed.

Integration Guide​

Before integrating this API, developers need to obtain the corresponding ServiceToken as the API access credential.

The production API is used as follows:

METHOD PATH HTTP/1.1
Host: minihost.tuanjie.cn
Authorization: Bearer <ServiceToken>
Content-Type: application/json

Both request and response bodies use JSON by default.

Order Query API​

Developers can use the order query API to proactively check the payment status of an order.

POST /game-api/v2/orders/order/query

Request Parameters​

FieldTypeRequiredDescription
appidstringYesMinigame Game ID
cp_order_nostringYesGame order number, generated by the developer system
channel_order_nostringYesChannel order number, generated by the platform

Request Example​

{
"appid": "appid",
"cp_order_no": "cp_order_no",
"channel_order_no": "channel_order_no"
}

Response Parameters​

FieldTypeDescription
codeint200 indicates success
messagestringError message
dataObjectOrder information

data Object​

FieldTypeDescription
appidstringMinigame Game ID
cp_order_nostringGame order number
cp_extrastringCustom pass-through parameter
channel_order_nostringChannel order number
amountint64Actual payment amount
quantityint64Purchase quantity
currencystringCurrency type, such as CNY
coupon_deduct_amountint64Coupon discount amount
product_codestringProduct code
product_namestringProduct name
product_priceint64Product unit price
statusstringOrder status
created_timeint64Order creation timestamp

Order Status​

StatusDescription
pendingWaiting for payment
completePayment completed
failedPayment failed
refundedRefunded

Response Example​

{
"code": 200,
"message": "success",
"data": {
"appid": "appid",
"cp_order_no": "cp_order_no",
"cp_extra": "extra_info",
"channel_order_no": "channel_order_no",
"amount": 100,
"quantity": 1,
"currency": "CNY",
"coupon_deduct_amount": 0,
"product_code": "example_product_code",
"product_name": "Example Product",
"product_price": 100,
"status": "pending",
"created_time": 1640995200
}
}

Refund Query API​

Developers can use the refund query API to proactively check the status of a refund order.

POST /game-api/v2/orders/refund/query

Request Parameters​

FieldTypeRequiredDescription
appidstringYesMinigame Game ID
refund_nostringYesRefund number

Request Example​

{
"appid": "appid",
"refund_no": "refund_no"
}

Response Parameters​

FieldTypeDescription
codeint200 indicates success
messagestringError message
dataObjectRefund information

data Object​

FieldTypeDescription
appidstringMinigame Game ID
cp_order_nostringGame order number
channel_order_nostringChannel order number
refund_nostringRefund number
refund_amountint64Refund amount
created_timeint64Refund request timestamp

Response Example​

{
"code": 200,
"message": "success",
"data": {
"appid": "appid",
"cp_order_no": "cp_order_no",
"channel_order_no": "channel_order_no",
"refund_no": "refund_no",
"refund_amount": 50,
"created_time": 1640995200
}
}