Skip to content

Payment - Order Query ​

This interface should be called on the server side. It must never be called directly from the front end (APP client, web page, minigame, etc.) to avoid the risk of credential leakage.

Interface Description ​

Interface Name pay.orderQuery

Description Query a payment order.

Note: This interface requires service communication secondary encryption and signatures: request parameters must be encrypted and signed, and responses must be signature-verified and decrypted. This effectively prevents data tampering and leakage.

Call Method ​

HTTPS Call ​

http
POST /v1/pay/order/query?access_token=ACCESS_TOKEN

Prepend the base URL for your game's service region to the API path. See Service Regions and API Addresses.

Request Parameters - Query ​

FieldTypeDefaultRequiredDescription
access_tokenstringYesAPI call credential

Request Parameters - Body ​

FieldTypeDefaultRequiredDescription
envnumberYesEnvironment: 0-production, 1-sandbox
out_trade_nostringYesBusiness order number

Response ​

The returned JSON data package

FieldTypeDescription
errcodeint32Error code
errmsgstringError message
modestringPayment type. Currently supported types: goods, game
product_idstringProduct ID
product_namestringProduct name
quantitynumberPurchase quantity
unit_pricenumberUnit price (in cents)
currencystringCurrency: CNY
out_trade_nostringBusiness order number
sud_trade_nostringSUD order number
envnumberEnvironment: 0-production, 1-sandbox
statusstringStatus, enum: PAYING-paying, PAID-paid, CLOSED-closed, DELIVERED-delivered, REFUNDING-refunding, REFUNDED-refunded, REFUND_FAIL-refund failed
attachstringPass-through data

Example ​

cURL Request ​

bash
# Mainland China example; use the corresponding base URL for other regions.
BASE_URL='https://cn-cpapi.sudbiz.cloud'

curl -X POST \
  "${BASE_URL}/v1/pay/order/query?access_token=ACCESS_TOKEN" \
  -H 'Content-Type: application/json; charset=utf-8' \
  -d '{
  "env": 0,
  "out_trade_no": "order_20231024123456"
}'

Request Example ​

json
{
  "env": 0,
  "out_trade_no": "order_20231024123456"
}

Response Example ​

json
{
  "errcode": 0,
  "errmsg": "ok",
  "mode": "goods",
  "product_id": "item_001",
  "product_name": "100 Coins",
  "quantity": 1,
  "unit_price": 600,
  "currency": "CNY",
  "out_trade_no": "order_20231024123456",
  "sud_trade_no": "sud_20231024123456",
  "env": 0,
  "status": "PAID",
  "attach": "custom_passthrough_data"
}