Redirected Integration

Let customers pay using a secure payment link that’s hosted by IOT Pay.

How It Works

Endpoint

https://ccapi.iotpaycloud.com/v3/cc_purchase

Method

POST

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

Redirect Purchase Guide

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Redirect Purchaseopen in new window which may help you when going through the documentation.

1. Request to Endpoint with format below
Request
namerequiredtypesampledescription
mchIdyString(30)10000701assigned by IOTPay
mchOrderNoyString(30)1234567890abcassigned by merchant
amountyInt1500in cents
currencyyString(3)CADfor now only CAD supported
loginNameyString(12)jack123merchant's login name
subjectnString(64)
bodynString(250)
channelyStringPF_CCPF_CC or UPI_EX
notifyUrlyString(200)get notify when success
returnUrlyString(200)https://example.comredirect to this url after payment
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
2. Redirect to `redirectUrl` in response below to IOTPay payment page
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retData.redirectUrlyStringif retCode=SUCCESS, merchant redirect to this url
retData.secureIdyStringFor embedded SDK integration only

Sample redirect url:

https://ccapi.iotpaycloud.com/cc/purchase?key={{secureId}}

3. After customer submit IOTPay form, payment page will automatically redirect to merchant supplied `returnUrl` with following parameters

Sample return url: https://example.com/?retCode=SUCCESS&status=2

namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgnString
statusyInt22 or 3 both mean the transaction is successful
NotifyUrl message(post request in json format)

At the same time, IOTPay will post to the merchant supplied notifyUrl with the following body:

namerequiredtypesampledescription
payOrderIdyStringPC20240101005605740403580191generated by IOTPay
mchIdyString10000701assigned by IOTPay
mchOrderNoyString1234567890abcassigned by merchant
originalOrderIdyStringoriginal pay order id if payType=refund
amountyInt1500in cents
currencyyStringCADonly 'CAD' supported
payTypeyStringpay or refund
refundableyInt1500in cents
statusyInt22 or 3 means success
paySuccTimeyString2021-04-07 19:44:51time stamp for the moment when the payment succeeded
cardNumyString432567******2266card number of the card used for the purchase
expiryDateyString0725expiry date of the card used for the purchase
invoiceNumyString
authNumyString
transNumyString
channelyStringPF_CCPF_CC or UPI_EX
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm

For details see Query Transaction

Card Tokenize Guide

IOTPay provides encryption and tokenization services with a secure data vault typically used to store payment card Primary Account Numbers in a PCI-DSS compliantopen in new window manner. IOTPay generates a unique and random token value to be used by your application instead of a clear or encrypted PAN, potentially reducing your PCI scope considerably.

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Card Tokenizeopen in new window which may help you when going through the documentation.

Endpoint - Add Card

https://ccapi.iotpaycloud.com/v3/cc_addCard

Method

POST

Header

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

1. Request to Endpoint with format below
Request
NameRequiredTypeSampleDescription
mchIdyString(30)0000701assigned by IOTPay
cardIdyString(30)604567999assigned by merchant, must be unique
loginNameyString(12)jack123merchant's login name
channelyStringPF_CCPF_CC or UPI_EX
returnUrlyString(200)redirect to this url after card is added
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm

Please note

Each cardId can bind only one credit card, if one user need to bind more cards, use different cardId

2. Redirect to `redirectUrl` in response to see IOTPay card form
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retData.redirectUrlyStringif retCode=SUCCESS, merchant redirect to this url
retData.secureIdyStringFor embedded SDK integration only
retData.channelyStringPF_CCPF_CC or UPI_EX

Sample redirect url: https://ccapi.iotpaycloud.com/cc/addcard?key={{secureId}}

3. After customer submit IOTPay form, payment page will automatically redirect to merchant supplied `returnUrl` with following parameters

Sample return url: https://example.com/?retCode=SUCCESS

nameRequiredtypesampledescription
retMsgyStringcardId already existMessage that show why the request had failed
retCodeyStringSUCCESS / FAIL
4. You can now use the cardId for future purchases

If you need to review the card information, you can call the QueryCard endpoint.

To purchase with the tokenized card, please use the PurchaseWithToken endpoint.

Last Updated: