# Order query interface

This interface is for WechatPay, Alipay and UnionPay only.

# Request URL:

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

# Request method: POST

field required type sample description
mchId y String(30) 1000000010 merchant id assigned by IOTPay
payOrderId y String(30) P20160427210604000490 order id assigned by third party payment system
mchOrderNo y String(30) 20160427210604000490 order id assigned by merchant
sign y String(32) C380BEC2BFD727A4B6845133519F3AD6 signature

use either payOrderId or mchOrderNo, use one of them

# return result

field type sample description
retCode String(16) SUCCESS SUCCESS/FAIL, retCode indicate communication status,
need to check resCode for transaction
retMsg String(128) signature error if not empty, it is error message

The following fields will return if retCode is SUCCESS

field required type sample description
resCode y String(16) SUCCESS SUCCESS/FAIL
errCode y String(32) SYSTEMERROR error code
errCodeDes y String(128) system error error message

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

field required type sample description
mchId y String(30) 20001222
mchOrderNo y String(30) 20160427210604000490
channelId y String(24) WX_JSAPI
currency y String(3) CAD
amount y int 100
clientIp n String(32)
device n String(64) WEB
notifyUrl y String(200) http://xxx.com/notify.php
subject y String(64) product title
body y String(256) product desc
param1 n String(64)
param2 n String(64) send the original value back
extra y String(512) {“openId”:”o2RvowBf7sOVJf8kJksUEMceaDqo”}
paySuccTime n Long 1505049094262 payment success time
channelOrderNo n String wx20170910211043fb206e92260071822007
status y int 2 or 3 order status, success: 2 or 3

# order status

0: created but not paid
1: user is paying, e.g. user is typing password
2: paid
3: paid and notified the merchant(if notifyUrl used)
4: cancelled by system
9: cancelled by user
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

# Demo and source code

Demo Source code

Last Updated: 11/25/2020, 2:00:25 PM