User Guide for Schedule Payment API ## Sections • [Introduction](https://developer.asiapay.com/recurring-payment/introduction.md): Welcome to User Guide for Schedule Payment API • [Introduction](https://developer.asiapay.com/recurring-payment/sechedule-payment/introduction-1.md): Schedule payment is an additional function of Paydollar E-Commerce Service. It can help merchant to pre-define different type of schedule credit card payment e.g. Monthly or weekly fee The System Flow of this module is as follows: - Merchant have to upload their member information such as Credit Card No, Expire Date, member id, schedule type, start date, end date in file format to us from our Web-base interface. Then Base on the Schedule Factor such as start date and schedule type (i.e. 3 week, 2 Month), provide by merchant, our system will work out and proceeds the transaction via a bank to debit his/her credit card. After, finished the transaction, the system will email a transaction log to the merchant. The merchant can also check that transaction via the web-base transaction report • [View Schedule Payment Report](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/view-schedule-payment-report.md): The Schedule Payment Report is provided for you to check all the schedule payment stored. In order to view it, you need to click the Report Button and then choose the Schedule Payment Report Link: Choose your selection criteria and then click the View button to view the schedule payment match your selection criteria For schedule payment, we have 5 kinds of status: Active - The schedule payment is active Suspend - The schedule payment is suspended Updated - The schedule payment is updated and it will not be active Deleted - The schedule payment is deleted Finished - The schedule payment is finished (end of period) To View the Detail, click the Detail link. Status of Detail Information: New – The next payment to be process Pending - The payment is processing Accepted - The payment is accepted Rejected - The payment is rejected (Resend of this payment please refer to section 2.7 Resent - The payment was resent. • [Add Schedule Payment by admin](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/add-schedule-payment-by-admin.md): In order to add a schedule payment, click on the Add button in Schedule Payment Report and then input all the required information in the Add Schedule Payment form: A Schedule Payment contain the following information: Title Description ield (* are required) Descriptions Schedule Type The time interval of a schedule payment e.g. 3 month, 10 days, 1 year Start Date (inclusive) The start date of the schedule payment and it is count inclusively e.g. 07/01/2001 (So if your schedule type is 2 month and start date = 07/01/2001, then the first transaction date with be 07/01/2001 and the second transaction date is 09/01/2001) End Date (inclusive) The end date of the schedule payment and it is count inclusively (remain empty for continue charging) e.g. 07/01/2002 Amount The amount of the schedule payment Merchant Reference No. A reference number generated by merchant to identify a schedule payment (prefer to be unique) e.g. Mfee-32424 Payer Name The name of the payer Payer Email The email of the payer Remark A remark for that schedule payment Pay Method Payment Method: VISA or MasterCard Account Number The account number of the card e.g. 4918914107195005 Holder Name The holder name of the card e.g. David Expiry Date The Card Expiry Date e.g. 07/2003 Status The status of the schedule payment: Active – The schedule payment is active Suspend – The schedule payment is suspended, can be reset to active Updated – The schedule payment is updated and now is inactive Deleted – The schedule payment is deleted Finished – The schedule payment is finished (end of the schedule) After filled the form, you need to click the Add button and you will see a confirmation page: Click the Confirm button and the schedule payment will then be added • [Add Schedule Payment by customer](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/add-schedule-payment-by-customer.md): In order to add a schedule payment by your customer with a first time transaction, you need to pass some additional parameter to our payment gateway receive page. And you can choose one of the following integration methods: Client Post through Browser or Direct Server Side Connection. Client Post method Required Parameter Title Description Parameters Data Type Descriptions orderRef Text (35) Merchant‘s Order Reference Number amount Number (12,2) The total amount your want to charge the customer currCode Text (3) The currency of the payment i.e. “344” – HKD “840” – USD “702” – SGD “156” – CNY (RMB) “392” – JPY “901” – TWD “036” – AUD “978” – EUR “826” – GBP “124” – CAD lang Text (1) The language of the payment page i.e. “C” – Traditional Chinese “E” – English “X” – Simplified Chinese “K” – Korean “J” – Japanese cancelUrl Text (300) A Web page address you want us to redirect upon the transaction being cancelled by your customer failUrl Text (300) A Web page address you want us to redirect upon the transaction being rejected by us successUrl Text (300) A Web page address you want us to redirect upon the transaction being accepted by us merchantId Number The merchant ID we provide to you payType Text(1); (“N”,”H”) The payment type: ”N” – Normal Payment (Sales) ”H” – Hold Payment (Authorize only) Remark: PPS and PayPal don’t have Hold Payment payMethod Text; (“ALL”,”CC”) The payment method: “ALL” – All the available payment method “CC” – Credit Card Payment appId Text {“SP”} Application Id ‘SP’ mean schedule payment schType Text {“Day”,”Month”,”Year”} Schedule type unit nSch Number Number of schedule type unit sMonth Number 1-12 The month of the start date sDay Number 1-31 The day of the start date sYear Number 2002 – 2099 The year of the start date eMonth Number 1-12 or empty The month of the end date eDay Number 1-31 or empty The day of the end date eYear Number 2002 – 2099 or empty The year of the end date name Text The name of the payer email Text The email of the payer schStatus Text {“Active”, “Suspend”} The status of the schedule payment Optional Parameter for connect to our payment page Title Description remark Text (200) A remark field for you to store additional data that will not show on the transaction web page SchPayAmt Number (12,2) The amount of schedule payment After you have passed the above parameters to our payment page, this transaction will be processed and will be treated as the first schedule payment of the start date if the transaction is accepted. After the integration has been completed, it is ready to launch your e-commerce web to serve your customers. Please copy the following PRODUCTION URL for client post method: CURL https://www.paydollar.com/b2c2/eng/payment/payForm.jsp Please copy the following TESTING URL for client post method: CURL https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp Direct Server Side Connection method Required Parameter for connect to our payment page Title Description Parameters Data Type Descriptions orderRef Text (35) Merchant‘s Order Reference Number amount Number (12,2) The total amount your want to charge the customer currCode Text (3) The currency of the payment i.e. “344” – HKD “840” – USD “702” – SGD “156” – CNY (RMB) “392” – JPY “901” – TWD “036” – AUD “978” – EUR “826” – GBP “124” – CAD lang Text (1) The language of the payment page i.e. “C” – Traditional Chinese “E” – English “X” – Simplified Chinese “K” – Korean “J” – Japanese pMethod Text (“VISA”,“Master”,”Diner s”,”JCB”, ” AMEX”) The payment card type epMonth Number(2) Credit card expiry month epYear Number(4) Credit card expiry year cardNo Text (16) Credit card number cardHolder Text (20) Credit card holder name securityCode Text (4) Credit Card Verification Code VISA: CVV (3-digit) MasterCard: CVC (3-digit) American Express: 4DBC (4-digit) merchantId Number The merchant ID we provide to you payType Text(1); (“N”,”H”) The payment type: ”N” – Normal Payment (Sales) ”H” – Hold Payment (Authorize only) Remark: PPS and PayPal don’t have Hold Payment payMethod Text; (“ALL”,”CC”) The payment method: “ALL” – All the available payment method “CC” – Credit Card Payment appId Text {“SP”} Application Id ‘SP’ mean schedule payment schType Text {“Day”,”Month”,”Year”} Schedule type unit nSch Number Number of schedule type unit sMonth Number 1-12 The month of the start date eDay Number 1-31 or empty The day of the end date eYear Number 2002 – 2099 or empty The year of the end date name Text The name of the payer email Text The email of the payer schStatus Text {“Active”, “Suspend”} The status of the schedule payment Optional Parameter for connect to our payment page Title Description remark Text (200) A remark field for you to store additional data that will not show on the transaction web page Parameter For 3D Transaction (Need to install MPI Server Software at Merchants’ site) Title Description vbvTransaction Text (“T”,”F”) 3D Transaction (i.e. Verified By VISA, SecureCode, J/Secure) “T” – True: The transaction has been gone through the VE/PA process. “F” – False: Non-3D transaction without go through the VE/PA process [ No need to send other 3D parameters except vbvTransECI ] vbvCHReturnCode Number Verify Enrollment Return Code Set to “0” if the enrolled value obtained in MPI VE Response Message is “Y” Set to “1001” if the enrolled value obtained in MPI VE Response Message is “N” Set to “-1” if the enrolled value is not available in MPI VE Response Message vbvPAReturnCode Number Payer Authentication Return Code Set to “0” if the status value obtained in MPI VE Response Message is “Y” Set to “1000” if the status value obtained in MPI VE Response Message is “A” Set to “1003” if the status value obtained in MPI VE Response Message is “N” Otherwise, set to “-1” vbvTransTime Text in format (YYYYMMDD HH:MM:SS) Transaction Time, time, MPI PA Response Message vbvTransAuth Text (28) Cardholder Authentication Verification Value, CAVV, value in MPI PA Response Message [ Must be in Base64-Encoded format ] vbvTransECI Text (2) Electronic Commerce Indicator, ECI, value in MPI PA Response Message For VISA & JCB card payment: For Enrolled 3D VISA card [ enrolled = Y ] Set it to the value of ECI obtained from MPI PA Response Message Set it to “07” if ECI value is not available in MPI PA Response Message For Not an Enrolled 3D VISA card [ enrolled = N ] Set it to “06” Otherwise, set it to “07” For MasterCard payment: For Enrolled 3D MasterCard [ enrolled = Y ] Set it to the value of ECI obtained from MPI PA Response Message Set it to “00” if ECI value is not available in MPI PA Response Message For Not an Enrolled 3D MasterCard [ enrolled = N ] Set it to “01” Otherwise, set it to “00 For Other credit card payment, set it to “07” vbvCAVVAlgo Text CAVV Algorithm, cavvAlgorithm, in MPI PA Response Message vbvXID Text(20) Transaction Identifier, xid, in MPI PA Response Message [ Must contain 20 characters ] vbvMerchantID Text Acquirer-defined Merchant Identifier, merID, in MPI PA Response Message vbvAcquirerBin Text Acquirer BIN, acqBIN, in MPI PA Response Message vbvTransStatus Text (1) Transaction Status, status, in MPI PA Response Message Set it to the value of status obtained from MPI PA Response Message Set it to “U” if the status value is not available in the MPI PA Response Message After you have passed the above parameters to our payment page, this transaction will be processed and will be treated as the first schedule payment of the start date if the transaction is accepted. After the integration has been completed, it is ready to launch your e-commerce web to serve your customers. Please copy the following PRODUCTION URL for direct server side connection method: Plain text https://www.paydollar.com/b2c2/eng/directPay/payComp.jsp Please copy the following TESTING URL for direct server side connection method: CURL https://test.paydollar.com/b2cDemo/eng/directPay/payComp.jsp So for example if you submit the transaction at 1/10/2002 and set the start date to be 1/20/2002 and the schedule period is 1 day, then the transaction processed will be treated as the first transaction of the schedule payment (1/20/2002) and the next schedule payment is on 1/21/2002. • [Update or Delete schedule payment](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/update-or-delete-schedule-payment.md): In order to update or delete a schedule payment, click on the Update link in the Schedule Payment Report to open the Update Schedule Payment Form: To delete a schedule payment, you need to change the Status to Deleted . After changed the information, click the Update button and then click the Confirm button to confirm the changes: Remark : When you update a schedule payment, a new schedule payment record will be added and the old will be changed to status Updated and will be inactive • [Upload a batch of schedule payments](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/upload-a-batch-of-schedule-payments.md): Step 1: Create a text file contain all the schedule payments for upload In order to upload a batch of schedule payment, you need to construct a text file will the following format: Header is required for format checking so you must provide it in the right format in the first row of the file and each field is separate by ‘Tab’ and each record is separate by ‘Enter’. Title Description Header Description Format N Schedule Item Number of schedule type unit Number e.g. 3 Schedule Type Schedule Type {“Month”, “Year”, “Day”} e.g. Month Start Date The Start Date of the schedule payment (inclusive) YYYYMMDD e.g. 20011201 End Date The End Date of the schedule payment (inclusive) YYYYMMDD or Empty e.g. 20021201 Currency The Currency Code {“344”} e.g. 344 Amount The Amount of the schedule payment Number (10, 2) e.g. 100.1 Merchant Ref. The merchant reference number to identify the schedule payment Text (allow empty) e.g. Mfee-13213 Payer Name The Name of the Payer Text (allow empty) e.g. David Payer Email The Email of the Payer Text (allow empty) e.g. david@hotmail.com Remark Remark of the schedule payment Text (allow empty) e.g. Member Fee of David Pay Method The payment method for the schedule payment {“VISA”, “Master”} e.g. VISA Account The card number Number e.g. 4918914107195005 Holder The holder name of the card TEXT e.g. David Ng Exp Month The expiry month of the card Number e.g. 8 Exp Year The expiry year of the card Number e.g. 2001 Status The status of the schedule payment {“Active”,”Suspend”} e.g. Active Sample file: --------------You can copy the following txt in notepad and then save as a file ----------- N Schedule Item Schedule Type Start Date End Date Currency Amount Merchant Ref. Payer Name Payer Email Remark Pay Method Account Holder Exp Month Exp Year Status 3 Month 20010101 20011201 344 5 test1 Edward Ng edward.ng@asiapay.com.hk testing only VISA 4918914107195005 Edward Ng 7 2003 Active 2 Month 20010201 20020201 344 2 test2 Edward Ng edward.ng@asiapay.com.hk testing only Master 5422882800700007 Edward Ng 7 2003 Active --------------End of the file ----------------------------------------------------------------------- Step 2: Upload the file After created the file in your disk, you can click the Upload button in the Schedule Payment Report and then you will see the Upload Schedule Payment as follow: To upload the file, click the Browse button and then select the file created before in your disk and then click the Upload button, you will then see the following screen: Click the Confirm button to transfer into our database, then the result will show • [Download Schedule Payment Master Record](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/download-schedule-payment-master-record.md): You can download the master records of schedule payment in a csv format by clicking the ‘Download’ button at the schedule payment report. • [Back End Process](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/back-end-process.md): In our system, we have a back-end process to proceeds those schedule payment transaction daily at night. After finished, we will send a email report to your email account. • [Email Notification of processing schedule payment](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/email-notification-of-processing-schedule-payment.md): We will send an email report to your contact email if your company has schedule payment processed in that day. The report format is like that: Schedule payment of (Test Schedule Payment) on 2002-01-03 • [Rejected transaction handling](https://developer.asiapay.com/recurring-payment/sechedule-payment/function-of-schedule-payment/rejected-transaction-handling.md): If you found that some of the transaction rejected, you need to check that is the card over card limit or the card is expired. After you have updated the credit card information of the payer, you can resend the rejected transaction by clicking the ReSend link in the Schedule Payment Detail Report of that transaction: • [Schedule Payment API](https://developer.asiapay.com/recurring-payment/schedule-payment-api.md): The function of Schedule Payment API Add schedule payment (with payment type) Change the credit card information of schedule payment record Change the amount of schedule payment record Delete schedule payment record Change the start/end date of schedule payment record Query function of schedule payment record Change the schedule type of schedule payment record Suspend / Reactivate the schedule payment record URL of Testing Platform: Plain text https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp • [Add Schedule Payment](https://developer.asiapay.com/recurring-payment/schedule-payment-api/add-schedule-payment.md): Parameters Data Type Mandatory Descriptions merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type (e.g. AddSchPay) sDay Number Y The start day of schedule payment sMonth Number Y The start month of schedule payment sYear Number Y The start year of schedule payment eDay Number Y The end day of schedule payment eMonth Number Y The end month of schedule payment eYear Number Y The end year of schedule payment amount Number Y The amount of schedule payment orderRef Text(35) Y The orderRef of schedule payment name Text(20) Y The name of schedule payment email Text(50) Y The email address of schedule payment remark Text(250) N The remark of schedule payment pMethod Text(10) Y The payment method of schedule payment (e.g. VISA,Master,JCB,AMEX) orderAcct Number Y The order account of schedule payment holderName Text(20) Y The holder name of credit card epMonth Number Y The card expiry month epYear Number Y The card expiry year mSchPayId Number N Master Schedule Id of another SchedulePay record. If this parameter is provided, the following information will be retrieved from previous record, pMethod orderAcct holderName epMonth epYear payRef Number N Payment reference of another transaction record. If this parameter is provided, the following information will be retrieved from previous record, pMethod orderAcct holderName epMonth epYear status Text(10) Y The status of schedule payment (e.g. Active,Suspend) nSch Number Y The number of schedule type (e.g. 1,2) schType Text(10) Y The schedule type of schedule payment (e.g. Day,Month,Year) payType Text(1) Y The payment type of schedule payment H – Hold Payment N – Normal Payment verification Text(1) N You can simply include “verification=T” in the parameter list to enable the verification function. When the function enabled, system will provide a verification that verifies the credit card before create schedule payment record. The system will make an authorized transaction for this purpose. The transaction details as below. 1.Amount: 1 2.OrderRef: VerifyCard_(MMddHHmmss) e.g. VerityCard_0331172305 Action type: AddSchPay Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=AddSchPay&sDay=16&sMonth=9& sYear=2009&eDay=16&eMonth=10&eYear=2009&amount=11&orderRef=TestSch20090916- 002&name=Test&email=kim.cheung@asiapay.com&remark=&pMethod=VISA&orderA cct=4918914107195005&holderName=Test Card&epMonth=07&epYear=2015&status=Active&nSch=1&schType=Month&payType =N Sample return string: Select... resultCode=0&mSchPayId=6697&merchantId=102491&orderRef=TestSch-20090916- 002&status=Active&errMsg=Add Successfully • [Change the credit card information of schedule payment record](https://developer.asiapay.com/recurring-payment/schedule-payment-api/change-the-credit-card-information-of-schedule-payment-record.md): Parameters Data Type Mandatory Descriptions merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type (e.g. UpdateSchPayCard) mSchPayId Number Y The Master Schedule Id of schedule payment pMethod Text(10) Y The payment method of schedule payment (e.g. VISA,Master,JCB,AMEX) orderAcct Number Y The order account of schedule payment holderName Text(20) Y The holder name of credit card epMonth Number Y The card expiry month epYear Number Y The card expiry year verification Text(1) N You can simply include “verification=T” in the parameter list to enable the verification function. When the function enabled, system will provide a verification that verifies the credit card before update the credit card information. The system will make an authorized transaction for this purpose. The transaction details as below. 1.Amount : 1 2.OrderRef : VerifyCard_(mSchPayId)_(MMddHHmmss) e.g. VerityCard_11007_0331172305 Action type: UpdateSchPayCard Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=UpdateSchPayCard&mSchPayId=66 94&pMethod=VISA&orderAcct=4335900000140045&holderName=Test Card2&epMonth=08&epYear=2018 Sample return string: Select... resultCode=-1&mSchPayId=6695&merchantId=102491&orderRef=TestSch20090916SchPay-001&status=Active&errMsg=Update successfully and the old record will be changed to status "Updated" and a new record with the same merchant reference number is added. • [Change the amount of schedule payment record](https://developer.asiapay.com/recurring-payment/schedule-payment-api/change-the-amount-of-schedule-payment-record.md): Parameters Data Type Mandatory Descriptions merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type (e.g. UpdateSchPayAmount) mSchPayId Number Y The Master Schedule Id of schedule payment amount Number Y The amount of schedule payment Action type: UpdateSchPayCard Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=UpdateSchPayAmount&mSchPayId =6695&amount=20 Sample return string: Select... resultCode=0&mSchPayId=6696&merchantId=102491&orderRef=TestSch20090916SchPay-001&status=Active&errMsg=Update successfully and the old record will be changed to status "Updated" and a new record with the same merchant reference number is added. • [Delete schedule payment record](https://developer.asiapay.com/recurring-payment/schedule-payment-api/delete-schedule-payment-record.md): Parameters Data Type Mandatory Descriptions merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type (e.g. DeleteSchPay) mSchPayId Number Y The Master Schedule Id of schedule payment Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=DeleteSchPay&mSchPayId=6697 Sample return string: Select... resultCode=0&mSchPayId=6697&merchantId=102491&orderRef=TestSch-20090916- 002&status=Deleted&errMsg=Delete successfully. • [Change the date of schedule payment record (Only support “Month” schedule type)](https://developer.asiapay.com/recurring-payment/schedule-payment-api/change-the-date-of-schedule-payment-record-only-support-month-schedule-type.md): Parameters Data Type Mandatory Description s merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type (e.g. UpdateSchPayDate) mSchPayId Number Y The Master Schedule Id of schedule payment sDay Number Y The start day of schedule payment sMonth Number Y The start month of schedule payment sYear Number Y The start year of schedule payment eDay Number Y The end day of schedule payment eMonth Number Y The end month of schedule payment eYear Number Y The end year of schedule payment Action type: UpdateSchPayDate Example 1: When the schedule payment record never process (Without last order date) You can update the parameters “sDay” and “eDay” for generate the next schedule date with a new day of month. You can update the parameters “sDay” and “eDay” for generate the next schedule date with a new day of month. Sample of the URL with parameters: Select... --Old record: sDay=12, sMonth=12, sYear=2009, eDay=12, eMonth=3, eYear=2010 --Next order date: 12/12/2009 Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=UpdateSchPayDate&mSchPayId=77 41&sDay=20&sMonth=12&sYear=2009&eDay=20&eMonth=3&eYear=2010 Sample return string: Select... resultCode=0&mSchPayId=7743&merchantId=102491&orderRef=TestSch-20091223- 005&status=Active&errMsg=Update successfully and the old record will be changed to status "Updated" and a new record with the same merchant reference number is added. --New record : sDay=20, sMonth=12, sYear=2009, eDay=20, eMonth=3, eYear=2010 --Next order date: 20/12/2009 Example 2: When the schedule payment record has processed (With last order date) You can update the parameter “eDay” for generate the next schedule date with a new day of month. --Old record: sDay=12, sMonth=12, sYear=2009, eDay=12, eMonth=3, eYear=2010 --Last order date: 12/12/2009 --Next order date: 12/1/2010 Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=UpdateSchPayDate&mSchPayId=77 44&sDay=12&sMonth=12&sYear=2009&eDay=20&eMonth=3&eYear=2010 Sample return string: Select... resultCode=0&mSchPayId=7745&merchantId=102491&orderRef=TestSch-20091223- 005&status=Active&errMsg=Update successfully and the old record will be changed to status "Updated" and a new record with the same merchant reference number is added. --New record: sDay=12, sMonth=12, sYear=2009, eDay=20, eMonth=3, eYear=2010 --Last order date: 12/12/2009 --Next order date: 20/1/2010 • [Query function of schedule payment record](https://developer.asiapay.com/recurring-payment/schedule-payment-api/query-function-of-schedule-payment-record.md): Parameters Data Type Mandatory Descriptions merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type (e.g. Query) mSchPayId Number Y The Master Schedule Id of schedule payment dSchPayId (Optional) Number N The Detail Schedule Id of schedule payment Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=Query&mSchPayId=7595 Sample of the URL with parameters: (With dSchPayId) Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=Query&mSchPayId=7595&dSchPay Id=216401 • [Change the schedule type of schedule payment record](https://developer.asiapay.com/recurring-payment/schedule-payment-api/change-the-schedule-type-of-schedule-payment-record.md): Parameters Data Type Mandatory Descriptions merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type (e.g. UpdateSchType) mSchPayId Number Y The Master Schedule Id of schedule payment nSch Number Y The number of schedule type (e.g. 1,2) schType Text(10) Y The schedule type of schedule payment (e.g. Day,Month,Year) Action type: UpdateSchType Example 1: When the schedule payment record never process (Without last order date) Before Update: (nSch=6 and schType=Month) --Next order date: 20/12/2011 After Update: (nSch=1 and schType=Month) --Next order date: 20/12/2011 Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10262 5&loginId=admin&password=xxxxxx&actionType=UpdateSchType&mSchPayId=1208 4&nSch=1&schType=Month Sample return string: Select... resultCode=0&mSchPayId=12085&merchantId=102625&orderRef=TestSch-20111220- 001&status=Active&errMsg=Update successfully and the old record will be changed to status "Updated" and a new record with the same merchant reference number is added. Example 2: When the schedule payment record has processed (With last order date) Before Update: (nSch=1 and schType=Month) --Last order date: 20/12/2011 --Next order date: 20/1/2012 After Update: (nSch=3 and schType=Month) --Last order date: 20/12/2011 --Next order date: 20/3/2012 Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10262 5&loginId=admin&password=xxxxxx&actionType=UpdateSchType&mSchPayId=1208 5&nSch=3&schType=Month Sample return string: Select... resultCode=0&mSchPayId=12086&merchantId=102625&orderRef=TestSch-20111220- 001&status=Active&errMsg=Update successfully and the old record will be changed to status "Updated" and a new record with the same merchant reference number is added. • [Suspend / Reactivate schedule payment record](https://developer.asiapay.com/recurring-payment/schedule-payment-api/suspend-reactivate-schedule-payment-record.md): Parameters Data Type Mandatory Descriptions merchantId Number Y The merchant Id loginId Text(50) Y The login id of using merchant API password Text(50) Y The password of using merchant API actionType Text(20) Y Action Type Suspend – SuspendSchPay Reactivate - ReactivateSchPay mSchPayId Number Y The Master Schedule Id of schedule payment Action type: SuspendSchPay Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=SuspendSchPay&mSchPayId=6697 Sample return string: Select... resultCode=0&mSchPayId=6697&merchantId=102491&orderRef=TestSch-20090916- 002&status=Suspend&errMsg=Suspend successfully. Action type: ReactivateSchPay (For reactivate the Suspended schPay record) Sample of the URL with parameters: Select... https://test.paydollar.com/b2cDemo/eng/merchant/api/schPayApi.jsp?merchantId=10249 1&loginId=admin&password=xxxxxx&actionType=ReactivateSchPay&mSchPayId=669 7 Sample return string: Select... resultCode=0&mSchPayId=6697&merchantId=102491&orderRef=TestSch-20090916- 002&status=Active&errMsg=Reactivate successfully. • [FAQ](https://developer.asiapay.com/recurring-payment/faq.md): 1) What is the meaning of nSch parameter in AddSchPay? I understand that the examples include 1, 2 , but what do 1, 2 mean as values for nSch? Ans: e.g. if the schType=Month, and nSch=1, it means charging once every month. if schType=Month, and nSch=3, it means charging every 3 months. 2) Given that I want to set up the subscription lasting forever until my customer cancels the subscription, so how do i set the eYear, eMonth and eDay? Are there any maximum values for these? Ans: Recurring payments would occur until terminated 3) what about currency? i realise that i can only set the amount in AddSchPay, but not the currency. I have previously asked this question, but it was not answered. Please advise. Ans: Each currency will have a different account. 4) is there a query function for me to retrieve each monthly transaction? I would like to know if there is a way for me to programatically retrieve the status and transaction id for the monthly subscription fee. Ans: Transaction details would be available via our reporting tools, which can be downloaded as csv files. 5) if the transaction was unsuccessful, for eg, on the 5th billing cycle, the customer's credit card bounced, do i trigger a retry? Ans: Yes 6) how many retries possible? Ans: No automated retries 7) will the unsuccessful schedule payment be rendered as suspended? Ans: Yes, only for this cycle. SchedulePay will continue to try on next cycle.