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

Payment

Place an Order

Endpoint

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

Parameters

Field NameVariable NameRequiredTypeExample ValueDescription
Merchant IDmchIdYesString(30)10000701Merchant ID assigned by the payment center
Merchant Order NomchOrderNoYesString(30)20160427210604000490Order number generated by merchant, must be unique
Merchant Contract NomchContractIdYesString(128)2177aac8-1c3e-4291-97e0-f63f69b34cb6Contract number generated by merchant, must be unique
Channel IDchannelIdYesString(24)WX_JSAPI, WX_APP, WX_MWEBSee Payment Channel Parameters
CurrencycurrencyYesString(3)CAD , CNY , USDThree-letter currency code, e.g. CAD
Payment AmountamountYesint100Payment amount in cents
Client IPclientIpNoString(32)
DevicedeviceNoString(50)Optional values: IOS, ANDROIDTerminal device ID (store ID or cashier ID), for PC web or WeChat official account payment please pass "WEB"
Notify URLnotifyUrlYesString(1000)https://xxx.com/notify.phpPayment result notification URL, must not contain ?
Product DescriptionbodyYesString(255)xxpay test productProduct description
Extra ParameterextraYesString(512)Required for WeChat Mini Program, WX_APP, WX_MWEB
Return URLreturnUrlNoString(1000)Required for WX_JSAPI, ALIPAY_PC, ALIPAY_WAPRedirect URL after payment, must not contain ?
Sub AccountjobNoYesString(50)Merchant login name
RemarksremarksNoString(200)Merchant remarks
SignaturesignYesString(32)C380BEC2BF3519F3AD6Signature value, see Signature Algorithm

WX_JSAPI Differentiation (Mini Program / H5 / Official Account)

If extra is not provided, it is considered H5/Official Account.

Extra Parameter Description

Mini Program Payment (WX_JSAPI)

Field NameVariable NameRequiredTypeExample ValueDescription
Extra ParamextraYesJSON{"type":"minipay","appId":"xxxxxxxxx"}type and appId are required

WeChat App Payment (WX_APP)

Field NameVariable NameRequiredTypeExample ValueDescription
Extra ParamextraYesJSON{"type":"apppay","appId":"xxxxxxxxx"}type and appId are required

Return Result

Field NameVariable NameTypeExample ValueDescription
Return CoderetCodeString(16)SUCCESSSUCCESS/FAIL, indicates communication status, transaction status determined by resCode
Return MsgretMsgString(128)Signature FailError message if not empty, e.g. Signature fail, parameter format error

The following fields are returned when retCode is SUCCESS

Field NameVariable NameRequiredTypeExample ValueDescription
Business ResultresCodeYesString(16)SUCCESSSUCCESS/FAIL
Error CodeerrCodeNoString(32)SYSTEMERRORError code
Error MsgerrCodeDesNoString(128)System ErrorError message

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

Field NameVariable NameTypeExample ValueDescription
Pay Order IDpayOrderIdString(30)P20160427210604000490Order ID generated by the payment center
Merchant IDmchIdString(30)20001222Merchant ID assigned by the payment center
Merchant Order NomchOrderNoString(30)20160427210604000490Order number generated by merchant
Channel IDchannelIdString(24)WX_JSAPISee Payment Channel Parameters
CurrencycurrencyString(3)CADThree-letter currency code
Amountamountint100Payment amount in cents
Statusstatusint2Payment status, 2 or 3 means success
Client IPclientIpString(32)210.73.10.148Client IP address
DevicedeviceString(64)WEBTerminal device ID, for PC web or official account payment please pass "WEB"
SubjectsubjectString(64)Test ProductProduct subject
BodybodyString(256)Test Product DescriptionProduct description
Channel Order NochannelOrderNoString(64)wx2016081611532915ae15b00b0167893571Order ID from third-party payment channel
Param1param1String(64)Returned as is (for WeChat Official Account payments, replaced with "mchOrderId")
Param2param2String(64)Returned as is
Payment TimepaySuccTimelongIn millisecondsPayment success timestamp
Notify TypebackTypeint1Notification type, 1-frontend, 2-backend
SignaturesignString(32)C380BEC2BFD727A4B6845133519F3AD6Signature value, see Signature Algorithm
AutodebitautodebitString(1)1Autodebit, 1-signed, 0-not signed
Merchant Contract IDmchContractIdString(128)b53554e6-edd5-472b-b534-fe137fbbb382Contract ID generated by merchant, must be unique
Iotpay Contract IDiotpayContractIdString(128)CWJ20250819011704375030054146Contract ID assigned by payment center
Currency AmountcurrencyAmountString(10)77Amount in cents. Returned only when currency differs from settlement currency

Payment Callback

Callback Method

POST https://merchant-notify-url

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

(same table as above)

Return Result

After processing, the merchant system must return string success to indicate success. If return is not success, it indicates failure. The payment center will retry notification up to 4 times.

Active Order Status Query

For merchants without backend (e.g., POS software integration) who cannot provide notifyUrl, order status can be checked actively via polling.
See order query API here

Double Insurance for Order Status

It is strongly recommended that merchants use both notifyUrl and polling (every 30 minutes) to ensure order status can be obtained.

Last Updated: 8/25/25, 7:28 PM
Prev
Contract Signing
Next
Query Order API