IOTPay DocumentationIOTPay Documentation
  • Introduction
  • Signing
  • General Order API
  • Customer Scan QR Code
  • Merchant Scan Barcode
  • Payment in WeChat Web Browser
  • WeChat Mini Program
  • Online Secure Payment
  • App integrate IOTPay
  • Order Query
  • Asynchronous Notify
  • Get Client IP
  • Refund interface
  • Query Refund
  • POS Semi-Integration
  • Wordpress WooCommerce plugin
  • V3

    • Introduction
    • Redirected Integration
    • Redirected Integration With 3DS and AVS
    • Embedded Integration
    • Direct Method
    • Query Card
    • Purchase With Token
    • Purchase with Wallet
    • Void Transaction
    • Refund Transaction
    • Query Transaction
    • UnionPay ExpressPay API
  • V2

    • Credit Card API V2(Deprecated)
  • Introduction
  • Contract Signing
  • Payment
  • Query Order API
  • Callback
  • English
  • 简体中文
  • Introduction
  • Signing
  • General Order API
  • Customer Scan QR Code
  • Merchant Scan Barcode
  • Payment in WeChat Web Browser
  • WeChat Mini Program
  • Online Secure Payment
  • App integrate IOTPay
  • Order Query
  • Asynchronous Notify
  • Get Client IP
  • Refund interface
  • Query Refund
  • POS Semi-Integration
  • Wordpress WooCommerce plugin
  • V3

    • Introduction
    • Redirected Integration
    • Redirected Integration With 3DS and AVS
    • Embedded Integration
    • Direct Method
    • Query Card
    • Purchase With Token
    • Purchase with Wallet
    • Void Transaction
    • Refund Transaction
    • Query Transaction
    • UnionPay ExpressPay API
  • V2

    • Credit Card API V2(Deprecated)
  • Introduction
  • Contract Signing
  • Payment
  • Query Order API
  • Callback
  • English
  • 简体中文
  • General Order

    • Introduction
    • Signing
    • General Order API
    • Customer Scan QR Code
    • Merchant Scan Barcode
    • Payment in WeChat Web Browser
    • WeChat Mini Program
    • Online Secure Payment
    • App integrate IOTPay
    • Order Query
    • Asynchronous Notify
    • Get Client IP
    • Refund interface
    • Query Refund
    • POS Semi-Integration
    • Wordpress WooCommerce plugin
  • CreditCard

    • V3

      • Introduction
      • Redirected Integration
      • Redirected Integration With 3DS and AVS
      • Embedded Integration
      • Direct Method
      • Query Card
      • Purchase With Token
      • Purchase with Wallet
      • Void Transaction
      • Refund Transaction
      • Query Transaction
      • UnionPay ExpressPay API
    • Credit Card API V2(Deprecated)
  • Autodebit

    • Introduction
    • Contract Signing
    • Payment
    • Query Order API
    • Callback

Query Order API

This API is only used for WeChat Pay, Alipay, and UnionPay.

API Request

Endpoint

POST https://apiv3.iotpaycloud.com/contract/query_order

Method

POST

Headers

Content-Type: application/x-www-form-urlencoded

! Note

After receiving the access credentials (Merchant ID, Login Name, Merchant Key),
you can test according to the demo Query Order.
This may help while reading the documentation.

Request Parameters

Field NameVariableRequiredTypeExample ValueDescription
Merchant IDmchIdYesString(30)1000000010Merchant number assigned by the payment center
Payment Order IDpayOrderIdYes*String(30)P20160427210604000490Order number generated by the payment center
Merchant Order NomchOrderNoYes*String(30)20160427210604000490Order number generated by the merchant
SignaturesignYesString(32)C380BEC2BFD727A4B6845133519F3AD6Signature value, see Signature Algorithm

Note

Only one of payOrderId or mchOrderNo needs to be included in the request parameters.

Response

Field NameVariableTypeExample ValueDescription
Return CoderetCodeString(16)SUCCESSSUCCESS/FAIL - This field indicates communication status, not transaction status. Check resCode to determine transaction result.
Return MessageretMsgString(128)Signature FailReturn message. If not empty, indicates error reason such as signature failure or parameter validation error.

The following fields are returned when retCode = SUCCESS

Field NameVariableRequiredTypeExample ValueDescription
Business ResultresCodeYesString(16)SUCCESSSUCCESS/FAIL
Error CodeerrCodeNoString(32)SYSTEMERRORError code
Error MessageerrCodeDesNoString(128)System ErrorError description

The following fields are returned when both retCode and resCode = SUCCESS

Field NameVariableRequiredTypeExample ValueDescription
Merchant IDmchIdYesString(30)20001222Merchant number assigned by the payment center
Merchant Order NomchOrderNoYesString(30)20160427210604000490Order number generated by the merchant
Channel IDchannelIdYesString(24)WX_JSAPISee Payment Channel Parameters
CurrencycurrencyYesString(3)CADThree-letter currency code, e.g., CAD
Payment AmountamountYesint100Payment amount in cents
Client IPclientIpNoString(32)210.73.10.148Client IP address
DevicedeviceNoString(64)WEBTerminal device number (store number or POS ID). For PC or WeChat Official Account, use "WEB".
Notify URLnotifyUrlYesString(200)http://xxx.com/notify.phpPayment result callback URL
SubjectsubjectYesString(64)Test ProductProduct subject
DescriptionbodyYesString(256)Test Product DescriptionProduct description
Extra Param 1param1NoString(64)Returned as-is during callback
Extra Param 2param2NoString(64)Returned as-is during callback
Extra ParametersextraYesString(512){"openId":
"o2RvowBf7sOVJf8kJksUEMceaDqo"}
Additional parameters for specific channels, see below.
Payment Success TimepaySuccTimeNoLong1505049094262Payment success timestamp
Channel Order NochannelOrderNoNoStringwx20170910211043fb206e92260071822007Third-party payment order number
Order StatusstatusYesint2 or 32 or 3 means success
Auto DebitautodebitString(1)1Auto debit status: 1-signed, 0-not signed
Merchant Contract IDmchContractIdString(128)b53554e6-eMerchant-generated unique contract ID
Iotpay Contract IDiotpayContractIdString(128)CWJ202508190117Contract ID assigned by the payment center

Order Status List

Status CodeDescription
0Created but not paid
1User on payment screen (e.g., entering password)
2Payment successful
3Payment successful and merchant notified
4Cancelled by system
9Cancelled by user

Note

When polling for order status, only status codes 2 or 3 indicate success.
If the status code is greater than 3, the order will never succeed, and polling can be stopped.

Error Codes

For more error codes, see here.

Query Contract API

API Request

Endpoint

POST https://apiv3.iotpaycloud.com/contract/query_contract

Method

POST

Headers

Content-Type: application/x-www-form-urlencoded

Request Parameters

Field NameVariableRequiredTypeExample ValueDescription
Merchant IDmchIdYesString(30)1000000010Merchant number assigned by the payment center
Merchant Contract IDmchContractIdYes*String(128)b53554e6-edd5-472b-b534-fe137fbbb382Merchant-generated unique contract ID
Iotpay Contract IDiotpayContractIdYes*String(128)CWJ20250819011704375030054146Contract ID assigned by the payment center
SignaturesignYesString(32)C380BEC2BFD727A4B6845133519F3AD6Signature value, see Signature Algorithm

Note

Only one of mchContractId or iotpayContractId needs to be included in the request parameters.

Response

Field NameVariableTypeExample ValueDescription
Return CoderetCodeString(16)SUCCESSSUCCESS/FAIL - This field indicates communication status, not transaction status. Check resCode to determine transaction result.
Return MessageretMsgString(128)Signature FailReturn message. If not empty, indicates error reason such as signature failure or parameter validation error.

The following fields are returned when retCode = SUCCESS

Field NameVariableRequiredTypeExample ValueDescription
Business ResultresCodeYesString(16)SUCCESSSUCCESS/FAIL
Error CodeerrCodeNoString(32)SYSTEMERRORError code
Error MessageerrCodeDesNoString(128)System ErrorError description

The following fields are returned when both retCode and resCode = SUCCESS

Field NameVariableRequiredTypeExample ValueDescription
Merchant Contract IDmchContractIdYesString(128)8034c925-bd31-470d-8e0f-9c0138634277Merchant-generated unique contract ID
Iotpay Contract IDiotpayContractIdYesString(128)CWJ20250819230751595515113500Contract ID assigned by the payment center
Contract StatusstatusYesint1Contract status: 1: Pending, 2: Signed, 9: Terminated
Signed AtsignedAtYesLong0Signing timestamp in milliseconds
Cancelled AtcancelledAtYesLong0Cancellation timestamp in milliseconds
Status DescriptionstatusDescriptionYesStringProcessingContract status description: Signed, Processing, Terminated
changelog
DateDescription
2024-08-26modify Variablesigned_at and cancelled_at to signedAtandcancelledAt
Last Updated: 8/25/25, 7:28 PM
Prev
Payment
Next
Callback