Create Request
The below API use for create Recurring order request by Http POST Method.
Then merchant have to redirect customer to payment page based on response CheckoutUrl.
| Environment | URL |
|---|---|
| Staging | https://stagingpayment.share-commerce.com/CreateCheckout/Recurring |
| Production | https://payment.share-commerce.com/CreateCheckout/Recurring |
Request (Json)
| Field Name | Data Type (Len) | M/O | Description |
|---|---|---|---|
| MerchantID | String (50) | M | Unique merchant's identification assigned to each merchant by Share Commerce. |
| Frequency | Integer | M | Recurring Occurrence. If FrequencyPeriod set as "MONTHLY" and FrequencyInterval set as 1: - Frequency set as 12, it will be charged for 12 months subsequently. *Value 0, it will be kept charging on customer until Merchant terminate the recurring or auto terminate due to maximum retry. |
| FrequencyPeriod | String (15) | M | Recurring Interval : - DAILY - WEEKLY - MONTHLY - YEARLY |
| FrequencyInterval | Integer | M | If FrequencyPeriod set as "MONTHLY" : - FrequencyInterval set as 1, it will be charged by Monthly. - or FrequencyInterval set as 2, it will be charged by Bi-Monthly / Every 2 Months. - or FrequencyInterval set as 3, it will be charged by Quarterly / Every 3 Months. |
| CurrencyCode | String (5) | M | Recurring currency code. |
| RecurringAmount | Decimal (18,2) | M | Recurring amount. |
| RecurringStartDate | String | M | Recurring 1st cycle payment date. Must be today date onwards with format yyyy-MM-dd. |
| MerchantOrderNo | String (50) | M | Unique identifier or order number generated by merchant, use it to track Recurring and subsequent cycle payment details. |
| MerchantOrderDesc | String (1000) | M | Merchant Order description |
| MerchantRef1 | String (100) | O | Merchant reference |
| MerchantRef2 | String (100) | O | Merchant reference |
| MerchantRef3 | String (100) | O | Merchant reference |
| CustName | String (150) | M | Customer name |
| CustEmail | String (150) | M | Customer email |
| CustPhoneCountryCode | String (5) | O | Customer phone number country code. Eg, Malaysia (60) |
| CustPhoneNo | String (50) | O | Customer phone number |
| CustAddress1 | String (100) | O | Customer address line 1 |
| CustAddress2 | String (100) | O | Customer address line 2 |
| CustAddressPostcode | String (15) | O | Customer address postcode |
| CustCountryCode | String (10) | O | Customer country code |
| CustAddressState | String (150) | O | Customer state |
| CustAddressCity | String (150) | O | Customer city |
| RedirectUrl | String (1000) | M | Merchant redirect URL to direct customer to merchant's confirmation or thank you page. |
| Versioning | Integer | O | API Versioning. Kindly put value as 2 |
| HTTP Header | Data Type (Len) | M/O | Description |
|---|---|---|---|
| SCSign | M | Message sign (Refer to below SCSign Calculation section) |
*Note, field SCSign have to pass in HTTP Header.
Request Sample
{
"MerchantID": "ABCDE12345",
"Frequency": 12,
"FrequencyPeriod": "MONTHLY",
"FrequencyInterval": 1,
"RetryDays": 0,
"MaxContinuouslyFailedCycles": 0,
"CurrencyCode": "MYR",
"RecurringAmount": 15.00,
"RecurringStartDate": "2023-07-12",
"MerchantOrderNo": "RecurringPayment_001",
"MerchantOrderDesc": "Membership Services",
"MerchantRef1": "",
"MerchantRef2": "",
"MerchantRef3": "",
"CustName": "Neilsa",
"CustEmail": "[email protected]",
"CustPhoneCountryCode": "60",
"CustPhoneNo": "",
"CustAddress1": "",
"CustAddress2": "",
"CustAddressPostcode": "",
"CustCountryCode": "",
"CustAddressState": "",
"CustAddressCity": "",
"RedirectUrl": "https://httpbin.org/anything",
"Versioning": 2
}
Response (Json)
Merchant Server shall examine field RespCode to determine the actual processing response of the request.
| Field Name | Data Type (Len) | M/O | Description |
|---|---|---|---|
| RespCode | String (50) | M | Payment response code. (Refer to Appendix 1 - Response code) |
| RespMessage | String (2000) | M | Result description of recurring payment transaction. |
| Result | Object | C | Only available for successful order / request creation. |
| Result.TxnRefNo | String (50) | M | Unique reference of a transaction, generated by system. |
| Result.CheckoutUrl | String | M | Payment checkout page url. |
| HTTP Header | Data Type (Len) | M/O | Description |
|---|---|---|---|
| SCSign | M | Message sign (Refer to below SCSign Calculation section) |
*Note, field SCSign will be exists in HTTP Header.
Response Sample
{
"RespCode": "00",
"RespMessage": "",
"Result": {
"TxnRefNo": "ABCD1111",
"CheckoutUrl": "https://stagingpayment.share-commerce.com/Checkout/Recurring/34dbc85b-de3b-43e7-995c-50ecd16ad66a"
}
}
SCSign Calculation
SCSign signature calculation, will sign with whole json string, and calculate with HMACSHA256 algorithm.
Secret Key : mSuE3Ttn5B8vJhe5ncMutMLV
Sign String (Example)
{"MerchantID":"ABCDE12345","Frequency":12,"FrequencyPeriod":"MONTHLY","FrequencyInterval":1,"RetryDays":0,"MaxContinuouslyFailedCycles":0,"CurrencyCode":"MYR","RecurringAmount":15,"RecurringStartDate":"2023-07-12","MerchantOrderNo":"RecurringPayment_001","MerchantOrderDesc":"Membership Services","MerchantRef1":"","MerchantRef2":"","MerchantRef3":"","CustName":"Neilsa","CustEmail":"[email protected]","CustPhoneCountryCode":"60","CustPhoneNo":"","CustAddress1":"","CustAddress2":"","CustAddressPostcode":"","CustCountryCode":"","CustAddressState":"","CustAddressCity":"","RedirectUrl":"https://httpbin.org/anything","Versioning":2}
SCSign (Calculated Value)
e1d159da1e7da6155fbce8568d10c6834c97346b47df694da22d88e3623a4141