Service Address
/DealerCustomer/AddCustomerWithCard
Request Parameters
DealerCustomerAuthentication
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. |
DealerCustomerRequest
Parameter |
Explanation |
CustomerCode (string) |
Unique code/number to identify the customer on the dealer side (Max 100 chars) |
Password (string) |
When the customer wants to withdraw from his stored card, if the dealer wants the customer's password to be asked as well, the customer's own password is entered in this field. (Max 50 chars) |
FirstName (string) |
Customer's name (Max 50 chars) |
LastName (string) |
Customer's last name (Max 50 chars) |
Gender (integer) |
Gender of the customer (1: male 2: female) |
BirthDate (date) |
Customer's date of birth (in YYYYMMDD format, ex: "19901218") |
GsmNumber (string) |
Customer's phone (Max 20 chars) |
GsmNumber (string) |
Customer's phone (Max 20 chars) |
Email (string) |
Customer's email (Max 100 chars) |
Address (string) |
Customer's address (Max 200 chars) |
CardHolderFullName (string) |
Card holder's name and surname (Max 100 chars) |
CardNumber (string) |
Card number |
ExpMonth (string) |
Expiry date, MONTH (in MM format, ex: "03") |
ExpYear (string) |
Expiry date, YEAR (in YYYY format, eg "2018") |
CardName (string) |
Name given to the card (eg: “My maximum card”) (Max 50 chars) |
Sample Request (JSON)
{
"DealerCustomerAuthentication": {
"DealerCode": "xxx",
"Username": "xxx",
"Password": "xxx",
"CheckKey": "aabbccddeeff"
},
"DealerCustomerRequest": {
"CustomerCode": "Customer",
"Password": "Elif1234",
"FirstName": "Elif",
"LastName": "Y",
"Gender": "2",
"BirthDate": "19850710",
"GsmNumber": "5301111111",
"Email": "elif.y@moka.com",
"Address": "TAŞDELEN",
"CardHolderFullName": "elif y",
"CardNumber": "1111222233335555",
"ExpMonth": "01",
"ExpYear": "2018",
"CardName": "Bonus kartım"
}
}
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 |
DealerCustomerId (integer) |
When the customer is added, his Unique Id in Moka is returned |
CustomerCode (string) |
Unique code given by the dealer to the customer |
Password (string) |
When the customer wants to withdraw from his stored card, if the dealer wants the customer's password to be asked, the customer's own password is entered in this field. (Max 50 chars) |
FirstName(string) |
If the customer is to be registered in the Moka system for the first time, the customer's name is entered. |
LastName (string) |
If the customer is to be registered in the Moka system for the first time, the customer's surname is entered. |
Gender (integer) |
If the customer is to be registered in the Moka system for the first time, the gender of the customer is entered. 1: male 2: female |
BirthDate (date) |
If the customer is to be registered in the Moka system for the first time, the date of birth of the customer is entered. |
GsmNumber (integer) |
If the customer is to be registered in the Moka system for the first time, the customer's mobile phone is entered. |
Email (integer) |
If the customer is to be registered in the Moka system for the first time, the customer's email address is entered. |
Address (integer) |
If the customer is to be registered in the Moka system for the first time, the customer's residential address is entered. |
CardListCount (integer) |
The number of the customer's stored cards. "1" |
CardList (Array) |
List of customer's stored cards
CardToken (guid) | Card's Token (Dealer will be able to withdraw from the card with this information) |
CardName (string) | Name given to the card (eg: “My maximum card”) (Max 50 chars) |
BankName (string) | Name of the card's bank (Issuer Bank) |
CardNumberFirstSix (string) | The first 6 digits of the card number (BIN number) |
CardNumberLastFour (string) | Last 4 digits of card number |
CardHolderFullName (string) | Card holder's name |
ExpMonth (string | Expiry date - MONTH (in MM format, ex: "03") |
ExpYear (string) | Expiry date - YEAR (in YYYY format, ex: "2020) |
|
Successful Result Example
{
"Data": {
"DealerCustomer": {
"DealerCustomerId": 1034,
"CustomerCode": "Customer",
"Password": "Elif1234",
"FirstName": "Elif",
"LastName": "Y",
"Gender": 2,
"BirthDate": "19850710",
"GsmNumber": "5301111111",
"Email": "elif.y@moka.com",
"Address": "TAŞDELEN"
},
"CardListCount": 1,
"CardList": [
{
"CardToken": "9de41bb0-e82f-4670-b36b-d71ff27a3111",
"CardName": "Bonus kartım",
"BankName": "BANKAADI",
"CardNumberFirstSix": "111122",
"CardNumberLastFour": "5555",
"CardHolderFullName": "elif y",
"ExpMonth": "01",
"ExpYear": "2018"
}
]
},
"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 |
DealerCustomer.AddCustomerWithCard.InvalidRequest | The CheckKey may be bad, or the object may be bad, or the JSON may be corrupt. |
DealerCustomer.AddCustomerWithCard.CustomerCodeAlreadyUsing | There is a registration with the customer code sent. |
DealerCustomer.AddCustomerWithCard.ExpMonthIsRequired | There is a registration with the customer code sent. |
DealerCustomer.AddCustomerWithCard.CardNumberIsRequired | Card number required. |
DealerCustomer.AddCustomerWithCard.CardHolderFullNameIsRequired | Card holder's name is required. |
DealerCustomer.AddCustomerWithCard.ExpYearIsRequired | An expiration date is required in year format. |
DealerCustomer.AddCustomer.InvalidEmailFormat | Invalid Email format |
EX | An unexpected error has occurred |
Example of Failed Result
{
"Data": null,
"ResultCode": "DealerCustomer.AddCustomerWithCard.InvalidDate",
"ResultMessage": "",
"Exception": null
}