Order Query

This endpoint is for WeChatPay, Alipay and UnionPay only.

API Request

Endpoint

https://api.iotpaycloud.com/v1/query_order

Method

POST

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

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Query Orderopen in new window to test out the workflow for this functionality. Which may help you when going through the documentation.

Parameters

NameRequiredTypeSampleDescription
mchIdyString(30)1000000010merchant id assigned by IOTPay
payOrderIdy*String(30)P20160427210604000490order id assigned by third party payment system
mchOrderNoy*String(30)20160427210604000490order id assigned by merchant
signyString(32)C380BEC2BFD727A4B6845133519F3AD6signature

Note

Only one of payOrderId or mchOrderNo is needed for the query.

Return Result

NameTypeSampleDescription
retCodeString(16)SUCCESSSUCCESS/FAIL, retCode indicate communication status,
need to check resCode for transaction
retMsgString(128)signature errorif not empty, it is error message

The following fields will return if retCode is SUCCESS

NameRequiredTypeSampleDescription
resCodeyString(16)SUCCESSSUCCESS/FAIL
errCodeyString(32)SYSTEMERRORerror code
errCodeDesyString(128)system errorerror message

The following fields will return if retCode and resCode are both SUCCESS

NameRequiredTypeSampleDescription
mchIdyString(30)20001222
mchOrderNoyString(30)20160427210604000490
channelIdyString(24)WX_JSAPI
currencyyString(3)CAD
amountyint100
clientIpnString(32)210.73.10.148
devicenString(64)WEB
notifyUrlyString(200)http://xxx.com/notify.php
subjectyString(64)product title
bodyyString(256)product desc
param1nString(64)
param2nString(64)send the original value back
extrayString(512){“openId”:”o2RvowBf7sOVJf8kJksUEMceaDqo”}
paySuccTimenLong1505049094262payment success time
channelOrderNonStringwx20170910211043fb206e92260071822007
statusyint2 or 3order status, success: 2 or 3

Order Status

StatusDescription
0created but not paid
1user is paying, e.g. user is typing password
2paid
3paid and notified the merchant(if notifyUrl used)
4cancelled by system
9cancelled by user

Note

When polling order status, only 2 or 3 is success, if status > 3, the order won't be success again, the polling can be stopped.

Error Code

more error code

Last Updated: