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

Contract Signing

Request Contract

Endpoint

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

Request Parameters

Field NameVariable NameRequiredTypeExample ValueDescription
Merchant IDmchIdYesString(30)10000701Merchant number assigned by the payment center
Merchant Contract IDmchContractIdYesString(128)2177aac8-1c3e-4291-97e0-f63f69b34cb6Merchant-generated order number, must be unique
Channel IDchannelIdYesString(24)WX_JSAPI, WX_APP, WX_MWEBSee Payment Channel Parameters
CurrencycurrencyYesString(3)CAD, CNY , USDThree-letter currency code, CAD for Canadian Dollar
Client IPclientIpNoString(32)210.73.10.148Client IP address
DevicedeviceNoString(50)Optional values IOS, ANDROIDTerminal device ID (store number or POS device ID), for PC Web or Official Account payments use "WEB"
Notify URLnotifyUrlYesString(1000)https://xxx.com/notify.phpCallback URL for contract signing result, do not include ?
Payer NamepayerNameYesString(32)Zhang SanName of the signing user, used for display on the page. No URL encoding required; UTF-8 non-3-byte characters not supported
Terminal TypeterminalTypeNoString(3)Optional values WEB, APP, WAPDevice type of the payer
Extra ParametersextraYesString(512)Required for WeChat Mini Program and WX_APP
Return URLreturnUrlNoString(1000)URL to redirect after signing. Must not contain ? and domain should match contract agreement
Sub AccountjobNoYesString(50)Merchant login name
SignaturesignYesString(32)C380BEC2BF3519F3AD6Signature value, see Signature Algorithm

Parameter Example

"params={
  "mchId": "10000000",
  "mchContractId": "2177aac8-1c3e-4291-97e0-f63f69b34cb6",
  "payerName": "Zhang San",
  "sign": "F64C43C1487C7C0DA93DA93DD2961FA2",
  "returnUrl": "http://ngrok.4jicao.com/goods/returnUrl",
  "clientIp": "127.0.0.1",
  "extra": "{\"openId\":\"o2RvowBf7sOVJf8kJksUEMceaDqo\", \"type\":\"minipay\",\"appId\":\"xxxxxxxxx\"}",
  "notifyUrl": "http://ngrok.4jicao.com/goods/payNotify",
  "currency": "CAD",
  "device": "WEB",
  "channelId": "WX_JSAPI"
}"

WX_JSAPI Distinguish Mini Program / H5 / Official Account

If extra is not provided, it is treated as H5 or Official Account.

Extra Parameter Explanation

Mini Program Payment (WX_JSAPI)

Field NameVariable NameRequiredTypeExample ValueDescription
Extra ParameterextraYesJSON{"openId":"o2RvowBf7sOVJf8kJksUEMceaDqo", "type":"minipay","appId":"xxxxxxxxx"}openId, type, appId are required

WeChat App Payment (WX_APP)

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

Response

WX_JSAPI (Mini Program) | WX_APP

Use sessionId as the parameter for SDK authorization.

{
  "resCode": "SUCCESS",
  "retCode": "SUCCESS",
  "retParams": "20250820078349254214",
  "retDetail": {
    "sessionId": "20250820078349254214"
  }
}

WX_JSAPI H5 / Official Account

{
  "resCode": "SUCCESS",
  "retCode": "SUCCESS",
  "retParams": "https://api.mch.weixin.qq.com/global/papay/contracts/login?os_session_id=20250820071335058284#wechat_pay",
  "retDetail": {
    "authUrl": "https://api.mch.weixin.qq.com/global/papay/contracts/login?os_session_id=20250820071335058284#wechat_pay"
  }
}

WX_MWEB

Returned URL is a link, not a QR code.

{
  "resCode": "SUCCESS",
  "retCode": "SUCCESS",
  "retParams": "https://osapp.pay.weixin.qq.com/global/papay/contracts/sessions/show_code?os_session_id=20250820072523252067",
  "retDetail": {
    "qrcodeUrl": "https://osapp.pay.weixin.qq.com/global/papay/contracts/sessions/show_code?os_session_id=20250820072523252067"
  }
}

Contract Status Callback

Callback Method

POST https://merchant-callback-url

Callback Parameters

Field NameVariable NameRequiredTypeExample ValueDescription
Iotpay Contract IDiotpayContractIdYesString10000701Merchant number assigned by the payment center
Merchant Contract IDmchContractIdYesString2177aac8-1c3e-4291-97e0-f63f69b34cb6Merchant-generated order number, must be unique
Contract StatusstatusYesStringOnly 2 is considered signedStatus: 1: waiting, 2: signed, 9: revoked
Signed TimesignedAtYesString1755558434000Signing timestamp in milliseconds
Cancelled TimecancelledAtYesString0Cancellation timestamp in milliseconds
Contract IDcontractIdNoString202508190766771823708667160266Contract ID
OpenIDopenIdNoStringosirq1BQeEV3-User's openId
SignaturesignYesStringB6A8F46537B4B5C888A9Signature, see Signature Algorithm

Revoke Contract

Endpoint

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

Request Parameters

Field NameVariable NameRequiredTypeExample ValueDescription
Merchant IDmchIdYesString(30)10000701Merchant number assigned by the payment center
Merchant Contract IDmchContractIdYesString(128)2177aac8-1c3e-4291-97e0-f63f69b34cb6Merchant-generated order number, must be unique
Sub AccountjobNoYesString(50)Merchant login name
CurrencycurrencyYesString(3)CAD, CNYThree-letter currency code, CAD for Canadian Dollar
SignaturesignYesString(32)C380BEC2BF3519F3AD6Signature, see Signature Algorithm

Response

This is a synchronous interface.

{
  "resCode": "SUCCESS",
  "retCode": "SUCCESS",
  "retParams": "",
  "retDetail": "SUCCESS"
}
{
  "resCode": "FAIL",
  "retCode": "FAIL",
  "retDetail": "",
  "retMsg": "contract is not signed yet "
}
Last Updated: 8/25/25, 7:28 PM
Prev
Introduction
Next
Payment