Add Schedule
Service Address
/DealerSale/AddSchedule
Request Parameters
DealerSaleAuthentication
Parameter | Explanation |
---|---|
DealerCode(string) | Dealer code issued by the Moka system |
Username (string) | Api username given by Moka system |
Password (string) | Api password given by Moka system |
CheckKey (string) | The control key (DealerCode + "MK" + Username + "PD" + Password) is created by passing this information, combined as a String, through the SHA-256 hash algorithm. Click here to go to the trial screen. |
DealerSaleRequest
Parameter | Explanation |
---|---|
ScheduleName (string) | Name of the time program (ex: "Monthly payment") (Max 100) |
DailyWeeklyMonthly (integer) | 1: Daily shot 2: Weekly shot 3: Monthly shot |
EveryX (integer) | On how many days, week or month will the payment be made (value of 1 means every day, week or month, value of 2 means every 2 days, every 2 weeks or every 2 months). |
DaysOfWeek (string) | Mandatory if DailyWeeklyMonthly = 2
Mandatory if DailyWeeklyMonthly = 2 (1: Monday, 2: Tuesday ....... 7: Sunday, days of the week can be separated by commas. eg: 1,3 Mondays and Wednesdays) |
DaysOfMonth (string) | Mandatory if DailyWeeklyMonthly = 3
(days of the month can be separated by commas. eg: 1.15, that is, the 1st and 15th days of the month will be shot) |
Sample Request (JSON)
{
"DealerSaleAuthentication": {
"DealerCode": "xxx",
"Username": "xxx",
"Password": "xxx",
"CheckKey": "aabbccddeeff"
},
"DealerSaleRequest": {
"ScheduleName": "newschedule",
"DailyWeeklyMonthly": "3",
"EveryX": "1",
"DaysOfWeek": "",
"DaysOfMonth": "15"
}
}
Successful Request Result
If the sent request data has been processed successfully in Moka, "Success" information is written in the "ResultCode" field of the return object . The "Data" field contains the result of the returned operation. You can continue your flows by checking the information in "Data" .
Parameter | Explanation |
---|---|
DealerSaleScheduleId (integer) | On the Moka side, it is the Unique ID of the time program. |
ScheduleName (string) | Name of the time program (ex: "Monthly payment") (Max 100) |
DailyWeeklyMonthly (integer) | 1: Daily shot 2: Weekly shot 3: Monthly shot |
EveryX (integer) | On how many days, week or month will the payment be made (value of 1 means every day, week or month, value of 2 means every 2 days, every 2 weeks or every 2 months). |
DaysOfWeek (string) | What days of the week will you shoot? 1: Monday 7: Sunday. If more than one day is to be shot, it is written as separated by commas. |
DaysOfMonth (string) | What days of the month will you shoot? If more than one day is to be shot, it is written as separated by commas. |
Successful Result Example
{
"Data": {
"DealerSaleScheduleId": 1005,
"ScheduleName": "newschedule",
"DailyWeeklyMonthly": 3,
"EveryX": 1,
"DaysOfWeek": "",
"DaysOfMonth": "15"
},
"ResultCode": "Success",
"ResultMessage": "",
"Exception": null
}
Failed Request Result
If the sent request data could not be processed in Moka streams, the "ResultCode" field of the return object contains one of the error codes in the table below.
When an unexpected software error occurs, EX is written in the "ResultCode" field and the error message (Exception) is displayed in the "ResultMessage" field
In both cases, the "Data" object arrives as null.
ResultCode | Explanation |
---|---|
DealerSale.AddSchedule.InvalidRequest | The CheckKey may be bad, or the object may be bad, or the JSON may be corrupt. |
DealerSale.AddSchedule.ScheduleNameIsRequired | The name of the time program is required. |
DealerSale.AddSchedule.DailyWeeklyMonthlyIsRequired | Information is required whether the shooting will be daily, weekly or monthly. |
DealerSale.AddSchedule.EveryXIsRequired | Information on how many days, weeks or months will be paid is required. |
DealerSale.AddSchedule.DaysOfWeekIsRequired | Information on which days of the week to shoot is required. |
DealerSale.AddSchedule.DaysOfMonthIsRequired | Information on which days of the month to shoot is required. |
DealerSale.AddSchedule.ScheduleNameAlreadyExists | The time program is already defined. |
DealerSale.AddSchedule.DaysOfWeekFormatError | The format of the information on which days of the week to shoot is incorrect. |
DealerSale.AddSchedule.DaysOfMonthFormatError | The format of the information on which days of the month to shoot is incorrect. |
EX | An unexpected error has occurred |
Example of Failed Result
{
"Data": null,
"ResultCode": "DealerSale.AddSchedule.ScheduleNameIsRequired",
"ResultMessage": "",
"Exception": null
}