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
    • Recurring Transactions
    • 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
    • Recurring Transactions
    • 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
      • Recurring Transactions
      • Void Transaction
      • Refund Transaction
      • Query Transaction
      • UnionPay ExpressPay API
    • Credit Card API V2(Deprecated)
  • Autodebit

    • Introduction
    • Contract Signing
    • Payment
    • Query Order API
    • Callback

Recurring Transactions

This documentation will cover the creation, query, and deletion of a recurring transaction of fixed $ amount.

Info

If a scheduled payment of a recurring transaction fails (including the first payment on startDate), the recurring transaction is halted: the order is marked as failed (status = 9), a failed notification is sent, and no further payments will be made. A halted recurring transaction is not cancelled, and is still returned by the query endpoints with last_payment set to the failed order. Use the cancel endpoint to stop a recurring transaction, and create a new one to resume charging the customer.

Creating Recurring Payment

Endpoint

https://ccapi.iotpaycloud.com/v3/recurring/create

Method:

POST

Header

Content-Type: application/json;charset=UTF-8

Important

If startDate is not included in the request: a startDate of the current date will be configured for this subscription and a payment will be made immediately with proceeding payments following the recurring frequency. If this first payment fails, no recurring transaction is created, retCode will be FAIL and retData will contain the failed order (status = 9).

If startDate is included in the request: no payment is made at creation. The first payment will be made on startDate (UTC), and retData will contain the pending order (status = 0) without payment details.

Request
NameRequiredTypeSampleDescription
mchIdyString10000701Assigned by IOTPay
mchOrderNoyString(50)1234567890abcAssigned by merchant, must be unique per merchant
cardIdyString(50)The cardId used for the add card endpoints (direct, redirect).
frequencyyString[w,2w,4w,m]Current possible configurations are w (weekly), 2w (bi-weekly), 4w (every 4 weeks, 28 days) or m (monthly, set day each given month)
startDatenInt1798761600The UNIX timestamp (seconds) for the first recurring payment; ie. 1798761600 => Fri Jan 01 2027 00:00:00 GMT+0000. Must be a date after the current UTC date and within 10 years. The first payment is made immediately if startDate not supplied
amountyInt1500In cents, must > 0
currencyyString(3)CADFixed to: CAD
loginNameyString(12)jack123Merchant's login name
notifyUrlyString(200)http://sample.com/notifyMerchant endpoint for receiving recurring payment notifications, must be http or https
descriptionnString(200)Test recurring order.Optional description for the recurring transaction
signyString(32)Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyStringFailed reason displayed here
retDatayJSONIf retCode=SUCCESS, order detailed info returned
retData contains order information:
namerequiredtypesampledescription
payOrderIdyStringPay order Id of the first order of this recurring transaction
mchIdyStringYour merchant Id
mchOrderNoyStringShould match request mchOrderNo
currencyyStringCAD
amountyInt100In cents, matching request amount
payTypeyStringpayFixed to pay
refundableyInt100In cents, matching amount
statusyInt0,2,30 = pending order (startDate supplied, first payment not made yet), 2 or 3 = success
invoiceNumnStringNot returned if startDate supplied
paySuccTimenString2021-04-07 19:44:51Timestamp of the successful payment. Not returned if startDate supplied
authNumnStringNot returned if startDate supplied
transNumnStringNot returned if startDate supplied
channelyStringPF_CCFixed to PF_CC
recurringIdyInt123Id of the newly created recurring payment, used by the query and cancel endpoints
cardIdyString(50)Should match request cardId
notifyUrlyString(200)http://sample.com/notifySupplied notifyUrl, should match request notifyUrl
frequencyyString[w,2w,4w,m]Should match request frequency
startDateyString2027-01-01Date of the first payment in UTC time (YYYY-MM-DD)
nextPaymentyString2027-01-08Date of the next scheduled payment in UTC time (YYYY-MM-DD), same as startDate if startDate supplied
descriptionnString(200)Test recurring order.Optional description for the recurring transaction, should match request description

Query Recurrings by Id

Responds with the exact recurring payment with the matching recurringId, along with a paginated list of the orders it has made

Endpoint

https://ccapi.iotpaycloud.com/v3/recurring/query

Method:

POST

Header

Content-Type: application/json;charset=UTF-8

Request
namerequiredtypesampledescription
mchIdyString10000701Assigned by IOTPay
loginNameyString(12)jack123Merchant's login name
recurringIdyInt123The recurringId returned by the (create recurring endpoint).
pagenInt1Page number of orders to return, defaults to 1
pageSizenInt20Number of orders per page, defaults to 20, max 100
signyString(32)Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retDatayJSONIf retCode is SUCCESS, the recurring payment detail be returned
retData contains the following recurring information:
namerequiredtypesampledescription
idyInt123The recurring Id
amountyInt100In cents
midyStringMerchant id
currencyyStringCADFixed to CAD
start_dateyString2027-01-01Payment start date in UTC time (YYYY-MM-DD)
frequencyyString[w,2w,4w,m]Current possible configurations are w (weekly), 2w (bi-weekly), 4w (every 4 weeks, 28 days) or m (monthly, set day each given month)
descriptionnString(200)Test recurring order.Optional description for the recurring transaction
last_paidyString2027-01-01Last successful payment date in UTC time (YYYY-MM-DD), defaults to "1970-01-01" if no payment has succeeded yet
last_paymentyStringPayorderid of the last payment, successful or failed, or of the pending first order if no payment has been made yet
next_paymentyString2027-01-08Date of next scheduled payment in UTC time (YYYY-MM-DD). If the last payment failed, stays at the date of that payment and no further payment will be made
cardIdyString(50)The cardId associated with this recurring payment
ordersyJSONPaginated list of the orders made by this recurring payment, newest first
orders contains the following pagination information:
namerequiredtypesampledescription
pageyInt1Current page number
pageSizeyInt20Number of orders per page
totalyInt45Total number of orders made by this recurring payment
lastPageyInt3Last page number
listyListOrders on the current page, empty if page is greater than lastPage
Each JSON object in orders.list contains the following order information:
namerequiredtypesampledescription
payOrderIdyStringId assigned by IOTPay
mchIdyStringYour merchant Id
mchOrderNoyStringThe request mchOrderNo for the first order, same as payOrderId for the following orders
originalOrderIdyStringPay order Id of the previous order of this recurring payment, empty for the first order
currencyyStringCAD
amountyInt100In cents
payTypeyStringpayFixed to pay
refundableyInt100In cents
statusyInt0,1,2,3,90 = pending order, 1 = unknown, 2 or 3 = success, 9 = fail
invoiceNumyString
paySuccTimeyString2021-04-07 19:44:51Timestamp of the successful payment, empty if the order has not been paid
authNumyString
transNumyString
channelyStringPF_CCFixed to PF_CC
recurringIdyInt123Should match request recurringId
capturenStringYFixed to Y
notifyUrlyString(200)http://sample.com/notifyThe notifyUrl supplied when creating the recurring payment

Query Recurrings by CardId

List all the recurring payments for the customer with provided cardId

Endpoint

https://ccapi.iotpaycloud.com/v3/recurring/query_by_card

Method:

POST

Header

Content-Type: application/json;charset=UTF-8

Request
namerequiredtypesampledescription
mchIdyString10000701Assigned by IOTPay
loginNameyString(12)jack123Merchant's login name
cardIdyString(50)The cardId used for the add card endpoints (direct, redirect).
signyString(32)Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retDatayListIf retCode is SUCCESS, a list of recurring payment(s) that used the cardId as the payment method will be returned (empty list if none)
Each JSON object in retData contains the following recurring information:
namerequiredtypesampledescription
idyInt123The recurring Id
amountyInt100In cents
midyStringMerchant id
currencyyStringCADFixed to CAD
start_dateyString2027-01-01Payment start date in UTC time (YYYY-MM-DD)
frequencyyString[w,2w,4w,m]Current possible configurations are w (weekly), 2w (bi-weekly), 4w (every 4 weeks, 28 days) or m (monthly, set day each given month)
descriptionnString(200)Test recurring order.Optional description for the recurring transaction
last_paidyString2027-01-01Last successful payment date in UTC time (YYYY-MM-DD), defaults to "1970-01-01" if no payment has succeeded yet
last_paymentyStringPayorderid of the last payment, successful or failed, or of the pending first order if no payment has been made yet
next_paymentyString2027-01-08Date of next scheduled payment in UTC time (YYYY-MM-DD). If the last payment failed, stays at the date of that payment and no further payment will be made
cardIdyString(50)Should match the given cardId in the request

Cancel Recurring Payment

To stop a recurring transaction. No further payments will be made, and the cancelled recurring payment will no longer be returned by the query endpoints

Endpoint

https://ccapi.iotpaycloud.com/v3/recurring/cancel

Method:

POST

Header

Content-Type: application/json;charset=UTF-8

Request
namerequiredtypesampledescription
mchIdyString10000701assigned by IOTPay
loginNameyString(12)jack123merchant's login name
recurringIdyInt123recurring payment id returned by the (create recurring endpoint)
signyString(32)Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyStringSuccessfully deleted recurring #255
retDatayJSONif retCode is SUCCESS, recurring payment detailed info returned
retData contains recurring information:
namerequiredtypesampledescription
idyInt123The recurring Id
amountyInt100In cents
midyStringMerchant id
currencyyStringCADFixed to CAD
start_dateyString2027-01-01Payment start date in UTC time (YYYY-MM-DD)
frequencyyString[w,2w,4w,m]Current possible configurations are w (weekly), 2w (bi-weekly), 4w (every 4 weeks, 28 days) or m (monthly, set day each given month)
descriptionnString(200)Test recurring order.Optional description for the recurring transaction
last_paidyString2027-01-01Last successful payment date in UTC time (YYYY-MM-DD), defaults to "1970-01-01" if no payment has succeeded yet
last_paymentyStringPayorderid of the last payment, successful or failed, or of the pending first order if no payment has been made yet
next_paymentyString2027-01-08Date of next scheduled payment in UTC time (YYYY-MM-DD). If the last payment failed, stays at the date of that payment and no further payment will be made
cardIdyString(50)The cardId associated with this recurring payment

Recurring Payment Notification

After each payment of a recurring transaction, IOTPay will send a notification to the notifyUrl supplied in the create request. This includes the first payment when startDate is not supplied (only if it succeeds), and every scheduled payment afterwards (whether it succeeds or not). A failed payment halts the recurring transaction, so a failed notification is the last one sent for it.

Important

Respond with the plain text SUCCESS once the notification is received. Otherwise, the notification will be sent again, up to 3 times in total, 60 seconds apart.

Method:

POST

Header

Content-Type: application/json;charset=UTF-8

Request
namerequiredtypesampledescription
payOrderIdyStringPay order Id of this payment
mchOrderIdyStringThe request mchOrderNo for the first payment, same as payOrderId for the following payments
channelyStringPF_CCFixed to PF_CC
amountyInt1500In cents
statusyStringsuccesssuccess means the payment went through; failed means it did not and the recurring transaction is halted. Treat any other value (pending, paying, returned) as not paid
recurringIdyInt123Recurring payment id this payment belongs to
previousOrderyStringPay order Id of the previous order of this recurring payment, empty for the first payment
paySuccessTimenString2021-04-07 19:44:51Timestamp of the successful payment, only included if the payment went through
signyString(32)Verify with the Sign algorithm using your merchant key
Last Updated: 10/9/26, 1:07 PM
Prev
Purchase with Wallet
Next
Void Transaction