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

App integrate IOTPay

Basic process

There are four roles in the whole integration:

1, Merchant App
2, Merchant backend server
3, IOTPay API server
4, Third party(Alipay, WeChatPay, UnionPay) server

Merchant App send payment request to IOTPay API server, IOTPay API return the encrypted data to the merchant app, then merchant app send the encrypted data to the third party pay server via SDK. IOTPay API server will notify merchant backend server when the transaction is successful.

An image

Merchant App call merchant backend server API

The API is defined by merchant, can use the following as reference:

Server address: https://merchant_server/pay?channelid=XXX&amount=xxx

  • Request method: GET

Merchant backend server call create order API of IOTPay, after get the request from merchant app.

For app integration, channel should be:

Channel IDChannel Name
WX_APPWeChat Pay
ALIPAY_MOBILEAlipay
UPI_APPUnionPay's SecurePay in app

After 2026-March-10, ALIPAY channelId = ALIPAY_MOBILE is not supported SDK integration. Please use diagram below for integration.

An image

API Request from Merchant Backend

Endpoint

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

Method

POST

Header

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

Parameters

namerequiredtypesampledescription
mchIdyString(30)10000701merchant ID assigned by IOTPay
mchOrderNoyString(30)20160427210604000490order number in merchant system, need to be unique
channelIdyString(24)ALIPAY_MOBILEALIPAY_MOBILE OR WX_APP OR UPI_APP
currencyyString(3)CADonly CAD and USD supported
amountyint100payment amounts, in cents, e.g. $28.56 is 2856
clientIpyString(32)210.73.10.148Client IP
devicenString(64)WEBdevice identifier
osTypenString(10)IOSALIPAY_MOBILE and ALIPAY_WAP are required! Possible values: IOS, ANDROID
notifyUrlyString(200)http://xxx.com/notify.phpIOTPay will notify this URL when payment success
returnUrlnString(200)ALIPAY_PC,ALIPAY_WAP,ALIPAY_MOBILE need thisredirect to this url after payment
subjectyString(64)product ID or titleproduct ID or title
bodyyString(255)product descriptionthe description of the product
param1nString(64)IOTPay will send back the original value
param2nString(64)IOTPay will send back the original value
extrayString(512){"type":"apppay","appId":"xxxxxxxxx"}WeChat mini program, WX_APP, WX_APP need this
jobNoyString(50)merchant login name
remarksnString(200)remarks
signyString(32)C380BEC2BFD727A4B6845133519F3AD6signature

WeChat App(WX_APP)

Note

To obtain your WeChat appId, please register your app at WeChat's Weixin Open Platform. Note that you will have to create an account if it's the first time you are using Weixin Open Platform.

namerequiredtypesampledescription
extrayJSON{"type":"apppay","appId":"xxxxxxxxx"}

Alipay App(ALIPAY_MOBILE) or UPI_APP

namerequiredtypesampledescription
extranJSONignore this parameter

PHP sample code

require_once('Utility.php');

$url = 'http://api.iotpaycloud.com/v1/create_order';
$merchantId  = '1000####';
$merchantKey = '#############################';

$channelId  = $_REQUEST['channelid'];
$orderAmount = $_REQUEST['amount'];

$orderNo = $_SERVER['REQUEST_TIME'];

$Utility = new Utility();
$ip = $Utility->real_ip();
$notifyUrl = 'https://develop.iotpay.ca/demo/order/notify.php';
$subject = 'test';
$body = 'payTest';

$extra = '';
if($channelId =='WX_APP')
{
  $appId  = 'wxxxxxxxxxxxxxx';
  $type = 'apppay';
  $extra = json_encode(array(
    'type' => $type,
    'appId' => $appId,
  ));
}

$arr = array(
    'mchId' => $merchantId,
    'mchOrderNo' => $orderNo,
    'extra' => $extra,
    'channelId' => $channelId,
    'currency' => 'CAD',
    'amount' => intval($orderAmount * 100),
    'clientIp' => $ip,
    'device' => 'WEB',
    'notifyUrl' => $notifyUrl,
    'subject' => $subject,
    'body' => $body,

);

$sortArray = $Utility->arg_sort($arr);

$arr['sign'] = $Utility->build_mysign($sortArray, $merchantKey, "MD5");//Generate signature parameter sign

$param = 'params=' . json_encode($arr);

$resBody = $Utility->request($url, $param);//Submit to the gateway

$res = json_decode($resBody, true);

echo json_encode($res['payParams']);  //client app use payParams to call sdk

WeChat/Alipay/UnionPay SDK and Documents:

  • Alipay SDK
  • Alipay source code
  • WeChat pay SDK
  • WeChat pay source code
  • Union Pay SDK for IOS
  • Union Pay SDK for Android

Demo source code

download

Changelog

2026-03-10

  • Add required field osType when channelId=ALIPAY_MOBILE , channelId=ALIPAY_WAP and the value should be ANDROID or IOS
  • Change response parameter for channelId=ALIPAY_PC, ALIPAY_WAP, ALIPAY_MOBILE
channelId = ALIPAY_MOBILE

Request params changed: osType is required and should be ANDROID or IOS

Response changed: The original retParams, retDetail and payParams are format of orderStr which is deprecated. payParams is the scheme url to open Alipay app retDetail is the html form to open Alipay page retParams.tradeNo is the order id of Alipay, which can be used to pay with Alipay's jssdk or Alipay's mini program

Response comparison: original response:

{
  "resCode": "SUCCESS",
  "retCode": "SUCCESS",
  "retParams": "service=\"mobile.securitypay.pay\"&partner=\"2088821558736584\"&out_trade_no=\"AA20260204145835078594034226\"&subject=\"testProduct\"&body=\"This is the description for the test product\"&total_fee=\"0.04\"&currency=\"CAD\"&payment_type=\"1\"&product_code=\"NEW_WAP_OVERSEAS_SELLER\"&seller_id=\"2088821558736584\"&notify_url=\"https://api.iotpaycloud.com/v1/alinotify\"&forex_biz=\"FP\"&it_b_pay=\"60m\"&secondary_merchant_id=\"344480625\"&secondary_merchant_name=\"IOT&PAY TECHNOLOGIES INC.\"&_input_charset=\"utf-8\"&sign=\"1jDCE7mrFu3BvmfMNsDqCGh%2B5gDblNbX8sZgB5Ex3PKi%2By1Vlec3DTaETpYP6jl%2FuRALV2dGcUs7jcwxL0uRQwkJZeXTLK1t22hbG6skr5mIfgiqkWaHdcLd%2BdG1q8x01CmQbYak3VGW8B4RZlzYHsS1lkdL%2BGlp8HdebYfQnFg%3D\"&sign_type=\"RSA\"",
  "payOrderId": "AA20260204145835078594034226",
  "mchOrderNo": "2329ccdd-3dc4-4cda-9db8-9e7830d462ee",
  "retDetail": "service=\"mobile.securitypay.pay\"&partner=\"2088821558736584\"&out_trade_no=\"AA20260204145835078594034226\"&subject=\"testProduct\"&body=\"This is the description for the test product\"&total_fee=\"0.04\"&currency=\"CAD\"&payment_type=\"1\"&product_code=\"NEW_WAP_OVERSEAS_SELLER\"&seller_id=\"2088821558736584\"&notify_url=\"https://api.iotpaycloud.com/v1/alinotify\"&forex_biz=\"FP\"&it_b_pay=\"60m\"&secondary_merchant_id=\"344480625\"&secondary_merchant_name=\"IOT&PAY TECHNOLOGIES INC.\"&_input_charset=\"utf-8\"&sign=\"1jDCE7mrFu3BvmfMNsDqCGh%2B5gDblNbX8sZgB5Ex3PKi%2By1Vlec3DTaETpYP6jl%2FuRALV2dGcUs7jcwxL0uRQwkJZeXTLK1t22hbG6skr5mIfgiqkWaHdcLd%2BdG1q8x01CmQbYak3VGW8B4RZlzYHsS1lkdL%2BGlp8HdebYfQnFg%3D\"&sign_type=\"RSA\"",
  "payParams": "service=\"mobile.securitypay.pay\"&partner=\"2088821558736584\"&out_trade_no=\"AA20260204145835078594034226\"&subject=\"testProduct\"&body=\"This is the description for the test product\"&total_fee=\"0.04\"&currency=\"CAD\"&payment_type=\"1\"&product_code=\"NEW_WAP_OVERSEAS_SELLER\"&seller_id=\"2088821558736584\"&notify_url=\"https://api.iotpaycloud.com/v1/alinotify\"&forex_biz=\"FP\"&it_b_pay=\"60m\"&secondary_merchant_id=\"344480625\"&secondary_merchant_name=\"IOT&PAY TECHNOLOGIES INC.\"&_input_charset=\"utf-8\"&sign=\"1jDCE7mrFu3BvmfMNsDqCGh%2B5gDblNbX8sZgB5Ex3PKi%2By1Vlec3DTaETpYP6jl%2FuRALV2dGcUs7jcwxL0uRQwkJZeXTLK1t22hbG6skr5mIfgiqkWaHdcLd%2BdG1q8x01CmQbYak3VGW8B4RZlzYHsS1lkdL%2BGlp8HdebYfQnFg%3D\"&sign_type=\"RSA\"",
  "sign": "F1D60EDB111026FDC36DC39DD85B5E3C"
}

New response:

{
  "resCode": "SUCCESS",
  "retCode": "SUCCESS",
  "retParams": {
    "url": "https://render.alipay.com/p/c/jzmcoal2/acn-wap-continue.html?url=alipayconnect%3a%2f%2fplatformapi%2facwallet%2falipayconnectcode%3fcode%3dgolcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox%26golSandbox%3dtrue%26pspName%3dALIPAY_CN&paymentId=20260204114010800190184000018685170&callback=https%3A%2F%2Fdev.iotpaycloud.com%2Fv1%2Fgalipayrtn%3Fpayorderid%3DAA20260204145804816118393649&amountValue=0.04&amountCurrency=CAD&county=US&merchantId=21841100000580I7&merchantName=IOT%26%2BPAY%20%E4%BD%A0%E5%A5%BD%20TECHNOLOGIES%20INC.&code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&referenceOrderId=b4ac8f53-a93f-4a82-8059-307644ce2166&paymentMethodType=ALIPAY_CN",
    "schemeUrl": "alipayconnect://platformapi/acwallet/alipayconnectcode?code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&golSandbox=true&pspName=ALIPAY_CN",
    "tradeNo": "20260204114010800190184000018685170"
  },
  "payOrderId": "AA20260204145804816118393649",
  "mchOrderNo": "b4ac8f53-a93f-4a82-8059-307644ce2166",
  "retDetail": "https://render.alipay.com/p/c/jzmcoal2/acn-wap-continue.html?url=alipayconnect%3a%2f%2fplatformapi%2facwallet%2falipayconnectcode%3fcode%3dgolcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox%26golSandbox%3dtrue%26pspName%3dALIPAY_CN&paymentId=20260204114010800190184000018685170&callback=https%3A%2F%2Fdev.iotpaycloud.com%2Fv1%2Fgalipayrtn%3Fpayorderid%3DAA20260204145804816118393649&amountValue=0.04&amountCurrency=CAD&county=US&merchantId=21841100000580I7&merchantName=IOT%26%2BPAY%20%E4%BD%A0%E5%A5%BD%20TECHNOLOGIES%20INC.&code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&referenceOrderId=b4ac8f53-a93f-4a82-8059-307644ce2166&paymentMethodType=ALIPAY_CN",
  "payParams": "alipayconnect://platformapi/acwallet/alipayconnectcode?code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&golSandbox=true&pspName=ALIPAY_CN",
  "sign": "662F9DA3B1E7AF77A2AE016C60F6F660"
}

Request sample:

curl --location --request POST 'https://api.iotpaycloud.com/v1/create_order' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Cache-Control: no-cache' \
--header 'Host: api.iotpaycloud.com' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: acw_tc=2f584a5017709191550335243ec00071ae250a5509c8bf3db46b6407f38bdd' \
--data-urlencode 'params={
    "mchId": "10000576",
    "mchOrderNo": "ef28ca74-f379-4a65-a246-c731d846d87b",
    "jobNo": "abcde",
    "currency": "CAD",
    "channelId": "ALIPAY_MOBILE",
    "amount": 4,
    "returnUrl": "https://iottest.requestcatcher.com",
    "notifyUrl": "https://gptest.requestcatcher.com",
    "subject":"testProduct",
    "body":"This is the description for the test product",
    "clientIp": "192.168.50.127",
    "osType":"ANDROID",
    "sign": "3837C685A81FCEB91C6E182D8294FCFD"
}'
Last Updated: 3/10/26, 5:43 PM
Prev
Online Secure Payment
Next
Order Query